Skip to content

Commit

Permalink
type the sensor states
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Jul 28, 2023
1 parent d92916d commit c98d6e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/openevse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def handle_state_change(
config_entry: ConfigEntry,
changed_entity: str,
old_state: State,
new_state: State,
new_state: State,
) -> None:
"""Listener to track state changes to sensor entities."""
manager = hass.data[DOMAIN][config_entry.entry_id][MANAGER]
grid_sensor = config_entry.data.get(CONF_GRID)
solar_sensor = config_entry.data.get(CONF_SOLAR)
grid = round(hass.states.get(grid_sensor).state)
solar = round(hass.states.get(solar_sensor).state)
grid = round(float(hass.states.get(grid_sensor).state))
solar = round(float(hass.states.get(solar_sensor).state))
invert = config_entry.data.get(CONF_INVERT)

if changed_entity in [grid_sensor, solar_sensor]:
Expand Down

0 comments on commit c98d6e3

Please sign in to comment.