Remove integrations from mypy ignored modules (part 4) (#64435)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-19 13:29:24 +01:00 committed by GitHub
parent 7520a3fd01
commit edaf75321e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 22 additions and 33 deletions

View file

@ -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)