Improve type hints in demo [1/3] (#77180)

This commit is contained in:
epenet 2022-08-29 00:51:10 +02:00 committed by GitHub
parent 575ac5ae0a
commit 7eb8e1f25d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 156 additions and 247 deletions

View file

@ -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."""