mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 18:27:51 +00:00
Enable strict typing for incomfort integration (#136291)
* Enable strict typing for incomfort integration * Comply to strict typing * Wrap in bool
This commit is contained in:
parent
ac7b9d7639
commit
59d677ba3e
@ -262,6 +262,7 @@ homeassistant.components.image_processing.*
|
|||||||
homeassistant.components.image_upload.*
|
homeassistant.components.image_upload.*
|
||||||
homeassistant.components.imap.*
|
homeassistant.components.imap.*
|
||||||
homeassistant.components.imgw_pib.*
|
homeassistant.components.imgw_pib.*
|
||||||
|
homeassistant.components.incomfort.*
|
||||||
homeassistant.components.input_button.*
|
homeassistant.components.input_button.*
|
||||||
homeassistant.components.input_select.*
|
homeassistant.components.input_select.*
|
||||||
homeassistant.components.input_text.*
|
homeassistant.components.input_text.*
|
||||||
|
@ -63,6 +63,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: InComfortConfigEntry) ->
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_unload_entry(hass: HomeAssistant, entry: InComfortConfigEntry) -> bool:
|
||||||
"""Unload config entry."""
|
"""Unload config entry."""
|
||||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
@ -102,7 +102,7 @@ class IncomfortBinarySensor(IncomfortBoilerEntity, BinarySensorEntity):
|
|||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Return the status of the sensor."""
|
"""Return the status of the sensor."""
|
||||||
return self._heater.status[self.entity_description.value_key]
|
return bool(self._heater.status[self.entity_description.value_key])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||||
|
@ -10,7 +10,6 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import (
|
||||||
SOURCE_RECONFIGURE,
|
SOURCE_RECONFIGURE,
|
||||||
ConfigEntry,
|
|
||||||
ConfigEntryState,
|
ConfigEntryState,
|
||||||
ConfigFlow,
|
ConfigFlow,
|
||||||
ConfigFlowResult,
|
ConfigFlowResult,
|
||||||
@ -29,6 +28,7 @@ from homeassistant.helpers.selector import (
|
|||||||
)
|
)
|
||||||
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
|
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
|
||||||
|
|
||||||
|
from . import InComfortConfigEntry
|
||||||
from .const import CONF_LEGACY_SETPOINT_STATUS, DOMAIN
|
from .const import CONF_LEGACY_SETPOINT_STATUS, DOMAIN
|
||||||
from .coordinator import async_connect_gateway
|
from .coordinator import async_connect_gateway
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ class InComfortConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
@callback
|
@callback
|
||||||
def async_get_options_flow(
|
def async_get_options_flow(
|
||||||
config_entry: ConfigEntry,
|
config_entry: InComfortConfigEntry,
|
||||||
) -> InComfortOptionsFlowHandler:
|
) -> InComfortOptionsFlowHandler:
|
||||||
"""Get the options flow for this handler."""
|
"""Get the options flow for this handler."""
|
||||||
return InComfortOptionsFlowHandler()
|
return InComfortOptionsFlowHandler()
|
||||||
|
@ -99,7 +99,7 @@ class IncomfortSensor(IncomfortBoilerEntity, SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def native_value(self) -> StateType:
|
def native_value(self) -> StateType:
|
||||||
"""Return the state of the sensor."""
|
"""Return the state of the sensor."""
|
||||||
return self._heater.status[self.entity_description.value_key]
|
return self._heater.status[self.entity_description.value_key] # type: ignore [no-any-return]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any] | None:
|
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||||
|
10
mypy.ini
generated
10
mypy.ini
generated
@ -2376,6 +2376,16 @@ disallow_untyped_defs = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = true
|
warn_unreachable = true
|
||||||
|
|
||||||
|
[mypy-homeassistant.components.incomfort.*]
|
||||||
|
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.input_button.*]
|
[mypy-homeassistant.components.input_button.*]
|
||||||
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