Improve type hints in demo [1/3] (#77180)
This commit is contained in:
parent
575ac5ae0a
commit
7eb8e1f25d
13 changed files with 156 additions and 247 deletions
|
@ -103,6 +103,8 @@ async def async_setup_entry(
|
|||
class DemoClimate(ClimateEntity):
|
||||
"""Representation of a demo climate device."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
unique_id: str,
|
||||
|
@ -125,7 +127,7 @@ class DemoClimate(ClimateEntity):
|
|||
) -> None:
|
||||
"""Initialize the climate device."""
|
||||
self._unique_id = unique_id
|
||||
self._name = name
|
||||
self._attr_name = name
|
||||
self._support_flags = SUPPORT_FLAGS
|
||||
if target_temperature is not None:
|
||||
self._support_flags = (
|
||||
|
@ -186,16 +188,6 @@ class DemoClimate(ClimateEntity):
|
|||
"""Return the list of supported features."""
|
||||
return self._support_flags
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
"""Return the polling state."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of the climate device."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def temperature_unit(self) -> str:
|
||||
"""Return the unit of measurement."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue