mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove unnecessary onewire variable (#42704)
This commit is contained in:
parent
5a4c1dbcc4
commit
744e4378ff
@ -76,16 +76,14 @@ class OneWireProxy(OneWire):
|
||||
def update(self):
|
||||
"""Get the latest data from the device."""
|
||||
value = None
|
||||
value_read = False
|
||||
try:
|
||||
value_read = self._read_value_ownet()
|
||||
self._value_raw = float(self._read_value_ownet())
|
||||
except protocol.Error as exc:
|
||||
_LOGGER.error("Owserver failure in read(), got: %s", exc)
|
||||
if value_read:
|
||||
else:
|
||||
if "count" in self._unit_of_measurement:
|
||||
value = int(value_read)
|
||||
value = int(self._value_raw)
|
||||
else:
|
||||
value = round(float(value_read), 1)
|
||||
self._value_raw = float(value_read)
|
||||
value = round(self._value_raw, 1)
|
||||
|
||||
self._state = value
|
||||
|
Loading…
x
Reference in New Issue
Block a user