mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Remove template from mypy ignore list (#74426)
This commit is contained in:
parent
b7cdf5412b
commit
5287980f48
@ -200,7 +200,7 @@ class NumberEntity(Entity):
|
||||
_attr_native_max_value: float
|
||||
_attr_native_min_value: float
|
||||
_attr_native_step: float
|
||||
_attr_native_value: float
|
||||
_attr_native_value: float | None = None
|
||||
_attr_native_unit_of_measurement: str | None
|
||||
_deprecated_number_entity_reported = False
|
||||
_number_option_unit_of_measurement: str | None = None
|
||||
|
@ -14,6 +14,7 @@ from homeassistant.components.number.const import (
|
||||
ATTR_VALUE,
|
||||
DEFAULT_MAX_VALUE,
|
||||
DEFAULT_MIN_VALUE,
|
||||
DEFAULT_STEP,
|
||||
DOMAIN as NUMBER_DOMAIN,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME, CONF_OPTIMISTIC, CONF_STATE, CONF_UNIQUE_ID
|
||||
@ -119,10 +120,9 @@ class TemplateNumber(TemplateEntity, NumberEntity):
|
||||
self._min_value_template = config[ATTR_MIN]
|
||||
self._max_value_template = config[ATTR_MAX]
|
||||
self._attr_assumed_state = self._optimistic = config[CONF_OPTIMISTIC]
|
||||
self._attr_native_value = None
|
||||
self._attr_native_step = None
|
||||
self._attr_native_min_value = None
|
||||
self._attr_native_max_value = None
|
||||
self._attr_native_step = DEFAULT_STEP
|
||||
self._attr_native_min_value = DEFAULT_MIN_VALUE
|
||||
self._attr_native_max_value = DEFAULT_MAX_VALUE
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Register callbacks."""
|
||||
|
@ -205,7 +205,7 @@ class SensorTemplate(TemplateSensor):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(hass, config=config, fallback_name=None, unique_id=unique_id)
|
||||
self._template = config.get(CONF_STATE)
|
||||
self._template: template.Template = config[CONF_STATE]
|
||||
if (object_id := config.get(CONF_OBJECT_ID)) is not None:
|
||||
self.entity_id = async_generate_entity_id(
|
||||
ENTITY_ID_FORMAT, object_id, hass=hass
|
||||
|
5
mypy.ini
5
mypy.ini
@ -2701,8 +2701,3 @@ ignore_errors = true
|
||||
[mypy-homeassistant.components.sonos.statistics]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.template.number]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.template.sensor]
|
||||
ignore_errors = true
|
||||
|
@ -31,8 +31,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.sonos.sensor",
|
||||
"homeassistant.components.sonos.speaker",
|
||||
"homeassistant.components.sonos.statistics",
|
||||
"homeassistant.components.template.number",
|
||||
"homeassistant.components.template.sensor",
|
||||
]
|
||||
|
||||
# Component modules which should set no_implicit_reexport = true.
|
||||
|
Loading…
x
Reference in New Issue
Block a user