mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Docstring updates (#2404)
* Fix docstring * Fix typo * Update docstrings * Update docstrings
This commit is contained in:
parent
fe0164b137
commit
3870d2e0cd
@ -33,7 +33,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
|
|
||||||
|
|
||||||
class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorDevice):
|
class EnvisalinkBinarySensor(EnvisalinkDevice, BinarySensorDevice):
|
||||||
"""Representation of an envisalink Binary Sensor."""
|
"""Representation of an Envisalink binary sensor."""
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, zone_number, zone_name, zone_type, info, controller):
|
def __init__(self, zone_number, zone_name, zone_type, info, controller):
|
||||||
|
@ -149,7 +149,7 @@ def setup(hass, base_config):
|
|||||||
EVL_CONTROLLER.stop()
|
EVL_CONTROLLER.stop()
|
||||||
|
|
||||||
def start_envisalink(event):
|
def start_envisalink(event):
|
||||||
"""Startup process for the envisalink."""
|
"""Startup process for the Envisalink."""
|
||||||
EVL_CONTROLLER.start()
|
EVL_CONTROLLER.start()
|
||||||
for _ in range(10):
|
for _ in range(10):
|
||||||
if 'success' in _connect_status:
|
if 'success' in _connect_status:
|
||||||
@ -175,7 +175,7 @@ def setup(hass, base_config):
|
|||||||
if not _result:
|
if not _result:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Load sub-components for envisalink
|
# Load sub-components for Envisalink
|
||||||
if _partitions:
|
if _partitions:
|
||||||
load_platform(hass, 'alarm_control_panel', 'envisalink',
|
load_platform(hass, 'alarm_control_panel', 'envisalink',
|
||||||
{'partitions': _partitions,
|
{'partitions': _partitions,
|
||||||
@ -191,7 +191,7 @@ def setup(hass, base_config):
|
|||||||
|
|
||||||
|
|
||||||
class EnvisalinkDevice(Entity):
|
class EnvisalinkDevice(Entity):
|
||||||
"""Representation of an envisalink devicetity."""
|
"""Representation of an Envisalink device."""
|
||||||
|
|
||||||
def __init__(self, name, info, controller):
|
def __init__(self, name, info, controller):
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
|
@ -33,7 +33,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def create(hass, message, title=None, notification_id=None):
|
def create(hass, message, title=None, notification_id=None):
|
||||||
"""Turn all or specified light off."""
|
"""Generate a notification."""
|
||||||
data = {
|
data = {
|
||||||
key: value for key, value in [
|
key: value for key, value in [
|
||||||
(ATTR_TITLE, title),
|
(ATTR_TITLE, title),
|
||||||
|
@ -30,7 +30,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
|
|
||||||
|
|
||||||
class EnvisalinkSensor(EnvisalinkDevice):
|
class EnvisalinkSensor(EnvisalinkDevice):
|
||||||
"""Representation of an envisalink keypad."""
|
"""Representation of an Envisalink keypad."""
|
||||||
|
|
||||||
def __init__(self, partition_name, partition_number, info, controller):
|
def __init__(self, partition_name, partition_number, info, controller):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
|
@ -51,7 +51,7 @@ def _include_yaml(loader, node):
|
|||||||
|
|
||||||
|
|
||||||
def _include_dir_named_yaml(loader, node):
|
def _include_dir_named_yaml(loader, node):
|
||||||
"""Load multiple files from dir as a dict."""
|
"""Load multiple files from directory as a dictionary."""
|
||||||
mapping = OrderedDict()
|
mapping = OrderedDict()
|
||||||
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
||||||
for fname in glob.glob(files):
|
for fname in glob.glob(files):
|
||||||
@ -61,7 +61,7 @@ def _include_dir_named_yaml(loader, node):
|
|||||||
|
|
||||||
|
|
||||||
def _include_dir_merge_named_yaml(loader, node):
|
def _include_dir_merge_named_yaml(loader, node):
|
||||||
"""Load multiple files from dir as a merged dict."""
|
"""Load multiple files from directory as a merged dictionary."""
|
||||||
mapping = OrderedDict()
|
mapping = OrderedDict()
|
||||||
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
||||||
for fname in glob.glob(files):
|
for fname in glob.glob(files):
|
||||||
@ -72,13 +72,13 @@ def _include_dir_merge_named_yaml(loader, node):
|
|||||||
|
|
||||||
|
|
||||||
def _include_dir_list_yaml(loader, node):
|
def _include_dir_list_yaml(loader, node):
|
||||||
"""Load multiple files from dir as a list."""
|
"""Load multiple files from directory as a list."""
|
||||||
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
||||||
return [load_yaml(f) for f in glob.glob(files)]
|
return [load_yaml(f) for f in glob.glob(files)]
|
||||||
|
|
||||||
|
|
||||||
def _include_dir_merge_list_yaml(loader, node):
|
def _include_dir_merge_list_yaml(loader, node):
|
||||||
"""Load multiple files from dir as a merged list."""
|
"""Load multiple files from directory as a merged list."""
|
||||||
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
files = os.path.join(os.path.dirname(loader.name), node.value, '*.yaml')
|
||||||
merged_list = []
|
merged_list = []
|
||||||
for fname in glob.glob(files):
|
for fname in glob.glob(files):
|
||||||
@ -89,7 +89,7 @@ def _include_dir_merge_list_yaml(loader, node):
|
|||||||
|
|
||||||
|
|
||||||
def _ordered_dict(loader, node):
|
def _ordered_dict(loader, node):
|
||||||
"""Load YAML mappings into an ordered dict to preserve key order."""
|
"""Load YAML mappings into an ordered dictionary to preserve key order."""
|
||||||
loader.flatten_mapping(node)
|
loader.flatten_mapping(node)
|
||||||
nodes = loader.construct_pairs(node)
|
nodes = loader.construct_pairs(node)
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ def _env_var_yaml(loader, node):
|
|||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
def _secret_yaml(loader, node):
|
def _secret_yaml(loader, node):
|
||||||
"""Load secrets and embed it into the configuration YAML."""
|
"""Load secrets and embed it into the configuration YAML."""
|
||||||
# Create secret cache on loader and load secret.yaml
|
# Create secret cache on loader and load secrets.yaml
|
||||||
if not hasattr(loader, '_SECRET_CACHE'):
|
if not hasattr(loader, '_SECRET_CACHE'):
|
||||||
loader._SECRET_CACHE = {}
|
loader._SECRET_CACHE = {}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user