Skip to content

Commit

Permalink
fix: mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed May 26, 2024
1 parent b9d1ae2 commit 32b9712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/powercalc/sensors/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ async def async_added_to_hass(self) -> None:
last_sensor_state = await self.async_get_last_sensor_data()
try:
if last_sensor_state and last_sensor_state.native_value:
self._set_native_value(Decimal(last_sensor_state.native_value))
self._set_native_value(Decimal(last_sensor_state.native_value)) #type: ignore
elif last_state:
self._set_native_value(Decimal(last_state.state))
_LOGGER.debug(
Expand Down Expand Up @@ -729,7 +729,7 @@ def calculate_new_state(
"""Calculate the new group energy sensor state
For each member sensor we calculate the delta by looking at the previous known state and compare it to the current.
"""
group_sum = Decimal(self._native_value_exact) if self._native_value_exact else Decimal(0) # type: ignore
group_sum = Decimal(self._native_value_exact) if self._native_value_exact else Decimal(0)
_LOGGER.debug("%s: Recalculate, current value: %s", self.entity_id, group_sum)
for entity_state in member_states:
if entity_state.state in [STATE_UNKNOWN, STATE_UNAVAILABLE]:
Expand Down

0 comments on commit 32b9712

Please sign in to comment.