Skip to content

Commit

Permalink
Ignore energy today drops if offline
Browse files Browse the repository at this point in the history
  • Loading branch information
hultenvp authored Jul 9, 2023
1 parent 5a97041 commit c1dff53
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions custom_components/solis/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
_LOGGER = logging.getLogger(__name__)

# VERSION
VERSION = '1.0.1'
VERSION = '1.0.2'

# Don't login every time
HRS_BETWEEN_LOGIN = timedelta(hours=2)
Expand Down Expand Up @@ -161,8 +161,11 @@ async def update_devices(self, data: GinlongData) -> None:
# messes up the energy dashboard. Return 0 while inverter is
# still off.
is_am = datetime.now().hour < 12
if getattr(data, INVERTER_STATE) == 2 and is_am:
value = 0
if getattr(data, INVERTER_STATE) == 2:
if is_am:
value = 0
else:
return
elif getattr(data, INVERTER_STATE) == 1 and is_am:
last_updated_state = None
try:
Expand Down

0 comments on commit c1dff53

Please sign in to comment.