mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
committed by
Paulus Schoutsen
parent
45484ba569
commit
03d94df3cd
@@ -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
|
||||
|
Reference in New Issue
Block a user