Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/sensor/efergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
+ app_token
response = get(url_string, timeout=10)
for sensor in response.json():
sid = sensor['sid']
sid = sensor['sid']+'_'+sensor['cid']

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use string formatting.

dev.append(EfergySensor(variable[CONF_SENSOR_TYPE], app_token,
utc_offset, variable[CONF_PERIOD],
variable[CONF_CURRENCY], sid))
Expand Down Expand Up @@ -143,7 +143,7 @@ def update(self):
+ self.app_token
response = get(url_string, timeout=10)
for sensor in response.json():
if self.sid == sensor['sid']:
if self.sid == sensor['sid']+'_'+sensor['cid']:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dito

measurement = next(iter(sensor['data'][0].values()))
self._state = measurement
else:
Expand Down