Improve type hints in demo (#74236)
This commit is contained in:
parent
fdb7a23171
commit
57fd84e20c
6 changed files with 82 additions and 73 deletions
|
@ -73,7 +73,7 @@ class DemoBinarySensor(BinarySensorEntity):
|
|||
)
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique id."""
|
||||
return self._unique_id
|
||||
|
||||
|
@ -83,16 +83,16 @@ class DemoBinarySensor(BinarySensorEntity):
|
|||
return self._sensor_type
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
def should_poll(self) -> bool:
|
||||
"""No polling needed for a demo binary sensor."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
def name(self) -> str:
|
||||
"""Return the name of the binary sensor."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if the binary sensor is on."""
|
||||
return self._state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue