Content-Length: 240039 | pFad | http://github.com/Aohzan/ecodevices/commit/0681b393f7210a2bdcca1b6ef3d4b626f3040c76

99 fix increment · Aohzan/ecodevices@0681b39 · GitHub
Skip to content

Commit

Permalink
fix increment
Browse files Browse the repository at this point in the history
  • Loading branch information
Aohzan committed Jun 22, 2022
1 parent 7ddac97 commit 0681b39
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.2.1

- Fix incrementation

## 4.2.0

- Replace deprecated async_get_registry method
4 changes: 2 additions & 2 deletions custom_components/ecodevices/sensor.py
Original file line number Diff line number Diff line change
@@ -576,8 +576,8 @@ def native_value(self) -> float:
"""Return the total value if it's greater than 0."""
value = float(self.coordinator.data["count1"])
old_state = await self.async_get_last_state()
if old_state is not None:
self._state = old_state.state
if old_state is not None:
self._state = old_state.state
if value > 0:
return value / 1000
raise EcoDevicesIncorrectValueError("Total value not greater than 0.")

0 comments on commit 0681b39

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Aohzan/ecodevices/commit/0681b393f7210a2bdcca1b6ef3d4b626f3040c76

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy