mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 08:07:45 +00:00
Enable strict typing in Tankerkoenig (#149535)
This commit is contained in:
parent
622cce03a1
commit
e30d405625
@ -501,6 +501,7 @@ homeassistant.components.tag.*
|
|||||||
homeassistant.components.tailscale.*
|
homeassistant.components.tailscale.*
|
||||||
homeassistant.components.tailwind.*
|
homeassistant.components.tailwind.*
|
||||||
homeassistant.components.tami4.*
|
homeassistant.components.tami4.*
|
||||||
|
homeassistant.components.tankerkoenig.*
|
||||||
homeassistant.components.tautulli.*
|
homeassistant.components.tautulli.*
|
||||||
homeassistant.components.tcp.*
|
homeassistant.components.tcp.*
|
||||||
homeassistant.components.technove.*
|
homeassistant.components.technove.*
|
||||||
|
@ -15,7 +15,6 @@ from aiotankerkoenig import (
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import (
|
||||||
ConfigEntry,
|
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
OptionsFlowWithReload,
|
OptionsFlowWithReload,
|
||||||
@ -40,6 +39,7 @@ from homeassistant.helpers.selector import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from .const import CONF_STATIONS, DEFAULT_RADIUS, DOMAIN
|
from .const import CONF_STATIONS, DEFAULT_RADIUS, DOMAIN
|
||||||
|
from .coordinator import TankerkoenigConfigEntry
|
||||||
|
|
||||||
|
|
||||||
async def async_get_nearby_stations(
|
async def async_get_nearby_stations(
|
||||||
@ -71,7 +71,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(
|
def async_get_options_flow(
|
||||||
config_entry: ConfigEntry,
|
config_entry: TankerkoenigConfigEntry,
|
||||||
) -> OptionsFlowHandler:
|
) -> OptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return OptionsFlowHandler()
|
return OptionsFlowHandler()
|
||||||
|
@ -110,7 +110,14 @@ class FuelPriceSensor(TankerkoenigCoordinatorEntity, SensorEntity):
|
|||||||
self._attr_extra_state_attributes = attrs
|
self._attr_extra_state_attributes = attrs
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self) -> float:
|
def native_value(self) -> float | None:
|
||||||
"""Return the current price for the fuel type."""
|
"""Return the current price for the fuel type."""
|
||||||
info = self.coordinator.data[self._station_id]
|
info = self.coordinator.data[self._station_id]
|
||||||
return getattr(info, self._fuel_type)
|
result = None
|
||||||
|
if self._fuel_type is GasType.E10:
|
||||||
|
result = info.e10
|
||||||
|
elif self._fuel_type is GasType.E5:
|
||||||
|
result = info.e5
|
||||||
|
else:
|
||||||
|
result = info.diesel
|
||||||
|
return result
|
||||||
|
10
mypy.ini
generated
10
mypy.ini
generated
@ -4768,6 +4768,16 @@ disallow_untyped_defs = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = true
|
warn_unreachable = true
|
||||||
|
|
||||||
|
[mypy-homeassistant.components.tankerkoenig.*]
|
||||||
|
check_untyped_defs = true
|
||||||
|
disallow_incomplete_defs = true
|
||||||
|
disallow_subclassing_any = true
|
||||||
|
disallow_untyped_calls = true
|
||||||
|
disallow_untyped_decorators = true
|
||||||
|
disallow_untyped_defs = true
|
||||||
|
warn_return_any = true
|
||||||
|
warn_unreachable = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.tautulli.*]
|
[mypy-homeassistant.components.tautulli.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user