parent
45484ba569
commit
03d94df3cd
1 changed files with 7 additions and 1 deletions
|
@ -109,4 +109,10 @@ class DteEnergyBridgeSensor(Entity):
|
|||
# A workaround for a bug in the DTE energy bridge.
|
||||
# The returned value can randomly be in W or kW. Checking for a
|
||||
# a decimal seems to be a reliable way to determine the units.
|
||||
self._state = val if '.' in response_split[0] else val / 1000
|
||||
# Limiting to version 1 because version 2 apparently always returns
|
||||
# values in the format 000000.000 kW, but the scaling is Watts
|
||||
# NOT kWatts
|
||||
if self._version == 1 and '.' in response_split[0]:
|
||||
self._state = val
|
||||
else:
|
||||
self._state = val / 1000
|
||||
|
|
Loading…
Add table
Reference in a new issue