Skip to content

Commit bfd44eb

Browse files
committed
Use ATTR_NAME when present
1 parent 2564283 commit bfd44eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugwise/smile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,11 @@ def get_appliance_data(self, dev_id):
843843
if measurement in ["compressor_state", "flame_state"]:
844844
self.active_device_present = True
845845

846+
try:
847+
measurement = attrs[ATTR_NAME]
848+
except KeyError:
849+
measurement = measurement
850+
846851
data[measurement] = format_measure(
847852
measure, attrs[ATTR_UNIT_OF_MEASUREMENT]
848853
)

0 commit comments

Comments
 (0)