Remove integrations from mypy ignored modules (part 4) (#64435)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
7520a3fd01
commit
edaf75321e
9 changed files with 22 additions and 33 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Final
|
||||
|
||||
from ovoenergy import OVODailyUsage
|
||||
|
@ -37,7 +37,7 @@ KEY_LAST_GAS_COST: Final = "last_gas_cost"
|
|||
class OVOEnergySensorEntityDescription(SensorEntityDescription):
|
||||
"""Class describing System Bridge sensor entities."""
|
||||
|
||||
value: Callable[[OVODailyUsage], StateType] = round
|
||||
value: Callable[[OVODailyUsage], StateType | datetime] = round
|
||||
|
||||
|
||||
SENSOR_TYPES_ELECTRICITY: tuple[OVOEnergySensorEntityDescription, ...] = (
|
||||
|
@ -158,7 +158,7 @@ class OVOEnergySensor(OVOEnergyDeviceEntity, SensorEntity):
|
|||
self.entity_description = description
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType:
|
||||
def native_value(self) -> StateType | datetime:
|
||||
"""Return the state."""
|
||||
usage: OVODailyUsage = self.coordinator.data
|
||||
return self.entity_description.value(usage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue