Update docstrings
This commit is contained in:
parent
70ce179224
commit
9157bd38e8
1 changed files with 7 additions and 7 deletions
|
@ -18,7 +18,7 @@ ENTITY_ID_PATTERN = re.compile(r"^(\w+)\.(\w+)$")
|
||||||
|
|
||||||
|
|
||||||
def generate_entity_id(entity_id_format, name, current_ids=None, hass=None):
|
def generate_entity_id(entity_id_format, name, current_ids=None, hass=None):
|
||||||
"""Generate a unique entity ID based on given entity IDs or used ids."""
|
"""Generate a unique entity ID based on given entity IDs or used IDs."""
|
||||||
name = (name or DEVICE_DEFAULT_NAME).lower()
|
name = (name or DEVICE_DEFAULT_NAME).lower()
|
||||||
if current_ids is None:
|
if current_ids is None:
|
||||||
if hass is None:
|
if hass is None:
|
||||||
|
@ -41,12 +41,12 @@ def valid_entity_id(entity_id):
|
||||||
|
|
||||||
|
|
||||||
class Entity(object):
|
class Entity(object):
|
||||||
"""ABC for Home Assistant entities."""
|
"""An abstract class for Home Assistant entities."""
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
# SAFE TO OVERWRITE
|
# SAFE TO OVERWRITE
|
||||||
# The properties and methods here are safe to overwrite when inherting this
|
# The properties and methods here are safe to overwrite when inheriting
|
||||||
# class. These may be used to customize the behavior of the entity.
|
# this class. These may be used to customize the behavior of the entity.
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""Return True if entity has to be polled for state.
|
"""Return True if entity has to be polled for state.
|
||||||
|
@ -57,7 +57,7 @@ class Entity(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return a unique id."""
|
"""Return an unique ID."""
|
||||||
return "{}.{}".format(self.__class__, id(self))
|
return "{}.{}".format(self.__class__, id(self))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -113,7 +113,7 @@ class Entity(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def assumed_state(self):
|
def assumed_state(self):
|
||||||
"""Return True if unable to access real state of entity."""
|
"""Return True if unable to access real state of the entity."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
@ -223,7 +223,7 @@ class Entity(object):
|
||||||
|
|
||||||
|
|
||||||
class ToggleEntity(Entity):
|
class ToggleEntity(Entity):
|
||||||
"""ABC for entities that can be turned on and off."""
|
"""An abstract class for entities that can be turned on and off."""
|
||||||
|
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Reference in a new issue