Skip to content

Commit

Permalink
fix: fix typing issues raised by mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleglaunec committed Nov 21, 2024
1 parent d26a275 commit 514d6c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custom_components/linkytic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import logging
from collections.abc import Callable
from typing import Generic, Optional, TypeVar, cast
from typing import Generic, Iterable, Optional, TypeVar, cast

from homeassistant.components.sensor import SensorEntity
from homeassistant.components.sensor.const import SensorDeviceClass, SensorStateClass
Expand All @@ -18,6 +18,7 @@
UnitOfPower,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_platform import AddEntitiesCallback

from .const import (
Expand Down Expand Up @@ -65,7 +66,7 @@ async def async_setup_entry(
)

# Init sensors
sensors = []
sensors: Iterable[Entity]
if config_entry.data.get(SETUP_TICMODE) == TICMODE_STANDARD:
# standard mode
sensors = [
Expand Down Expand Up @@ -1081,7 +1082,7 @@ def __init__(self, tag: str, config_title: str, reader: LinkyTICReader) -> None:
self._config_title = config_title

@property
def native_value(self) -> T | None:
def native_value(self) -> T | None: # type:ignore
"""Value of the sensor."""
return self._last_value

Expand Down

0 comments on commit 514d6c5

Please sign in to comment.