diff --git a/custom_components/tahoma/__init__.py b/custom_components/tahoma/__init__.py index 80026ffd2..67f696956 100644 --- a/custom_components/tahoma/__init__.py +++ b/custom_components/tahoma/__init__.py @@ -1,4 +1,4 @@ -"""The Tahoma integration.""" +"""The TaHoma integration.""" import asyncio import voluptuous as vol @@ -48,12 +48,12 @@ async def async_setup(hass: HomeAssistant, config: dict): - """Set up the Tahoma component.""" + """Set up the TaHoma component.""" return True async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): - """Set up Tahoma from a config entry.""" + """Set up TaHoma from a config entry.""" hass.data.setdefault(DOMAIN, {}) @@ -68,7 +68,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): # TODO Add better exception handling except RequestException: - _LOGGER.exception("Error when getting devices from the Tahoma API") + _LOGGER.exception("Error when getting devices from the TaHoma API") return False hass.data[DOMAIN][entry.entry_id] = { @@ -87,7 +87,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): else: _LOGGER.warning( - "Unsupported Tahoma device (%s - %s - %s)", + "Unsupported TaHoma device (%s - %s - %s)", _device.type, _device.uiclass, _device.widget, diff --git a/custom_components/tahoma/binary_sensor.py b/custom_components/tahoma/binary_sensor.py index 047e8f53f..d49c7aa4c 100644 --- a/custom_components/tahoma/binary_sensor.py +++ b/custom_components/tahoma/binary_sensor.py @@ -1,4 +1,4 @@ -"""Support for Tahoma binary sensors.""" +"""Support for TaHoma binary sensors.""" from datetime import timedelta import logging @@ -21,7 +21,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma sensors from a config entry.""" + """Set up the TaHoma sensors from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -36,7 +36,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaBinarySensor(TahomaDevice, BinarySensorEntity): - """Representation of a Tahoma Binary Sensor.""" + """Representation of a TaHoma Binary Sensor.""" def __init__(self, tahoma_device, controller): """Initialize the sensor.""" diff --git a/custom_components/tahoma/config_flow.py b/custom_components/tahoma/config_flow.py index dbbbd7e97..83e23884f 100644 --- a/custom_components/tahoma/config_flow.py +++ b/custom_components/tahoma/config_flow.py @@ -1,4 +1,4 @@ -"""Config flow for Tahoma integration.""" +"""Config flow for TaHoma integration.""" import logging import voluptuous as vol @@ -31,7 +31,7 @@ async def validate_input(hass: core.HomeAssistant, data): controller = await hass.async_add_executor_job(TahomaApi, username, password) except RequestException: - _LOGGER.exception("Error when trying to log in to the Tahoma API") + _LOGGER.exception("Error when trying to log in to the TaHoma API") raise CannotConnect # If you cannot connect: @@ -44,7 +44,7 @@ async def validate_input(hass: core.HomeAssistant, data): class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): - """Handle a config flow for Tahoma.""" + """Handle a config flow for TaHoma.""" VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL diff --git a/custom_components/tahoma/const.py b/custom_components/tahoma/const.py index 7e77d5a7b..b1429c857 100644 --- a/custom_components/tahoma/const.py +++ b/custom_components/tahoma/const.py @@ -14,9 +14,9 @@ DEVICE_CLASS_OPENING ) -"""Constants for the Tahoma integration.""" +"""Constants for the TaHoma integration.""" -DOMAIN = "tahoma" +DOMAIN = "TaHoma" # Used to map the Somfy uiClass to the Home Assistant platform TAHOMA_TYPES = { @@ -62,7 +62,7 @@ "ContactSensor": DEVICE_CLASS_OPENING } -# Tahoma Attributes +# TaHoma Attributes ATTR_MEM_POS = "memorized_position" ATTR_RSSI_LEVEL = "rssi_level" ATTR_LOCK_START_TS = "lock_start_ts" @@ -70,7 +70,7 @@ ATTR_LOCK_LEVEL = "lock_level" ATTR_LOCK_ORIG = "lock_originator" -# Tahoma internal device states +# TaHoma internal device states CORE_RSSI_LEVEL_STATE = "core:RSSILevelState" CORE_STATUS_STATE = "core:StatusState" CORE_CLOSURE_STATE = "core:ClosureState" diff --git a/custom_components/tahoma/cover.py b/custom_components/tahoma/cover.py index 80c69c3ac..ea2a9f409 100644 --- a/custom_components/tahoma/cover.py +++ b/custom_components/tahoma/cover.py @@ -1,4 +1,4 @@ -"""Support for Tahoma cover - shutters etc.""" +"""Support for TaHoma cover - shutters etc.""" from datetime import timedelta import logging @@ -51,7 +51,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma covers from a config entry.""" + """Set up the TaHoma covers from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -66,7 +66,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaCover(TahomaDevice, CoverEntity): - """Representation a Tahoma Cover.""" + """Representation a TaHoma Cover.""" def __init__(self, tahoma_device, controller): """Initialize the device.""" diff --git a/custom_components/tahoma/light.py b/custom_components/tahoma/light.py index 3f6b5dafe..0e7bead06 100644 --- a/custom_components/tahoma/light.py +++ b/custom_components/tahoma/light.py @@ -1,4 +1,4 @@ -"""Tahoma light platform that implements dimmable tahoma lights.""" +"""TaHoma light platform that implements dimmable TaHoma lights.""" import logging from datetime import timedelta @@ -21,7 +21,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma lights from a config entry.""" + """Set up the TaHoma lights from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] diff --git a/custom_components/tahoma/lock.py b/custom_components/tahoma/lock.py index a406ad8c2..7307b5965 100644 --- a/custom_components/tahoma/lock.py +++ b/custom_components/tahoma/lock.py @@ -1,4 +1,4 @@ -"""Support for Tahoma lock.""" +"""Support for TaHoma lock.""" from datetime import timedelta import logging @@ -15,7 +15,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma locks from a config entry.""" + """Set up the TaHoma locks from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -30,7 +30,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaLock(TahomaDevice, LockEntity): - """Representation a Tahoma lock.""" + """Representation a TaHoma lock.""" def __init__(self, tahoma_device, controller): """Initialize the device.""" diff --git a/custom_components/tahoma/manifest.json b/custom_components/tahoma/manifest.json index bce03eb6a..26041ab2c 100644 --- a/custom_components/tahoma/manifest.json +++ b/custom_components/tahoma/manifest.json @@ -2,7 +2,7 @@ "domain": "tahoma", "name": "Somfy TaHoma", "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/tahoma", + "documentation": "https://www.home-assistant.io/integrations/TaHoma", "requirements": [], "codeowners": ["@philklei", "@imicknl", "@vlebourl"] } diff --git a/custom_components/tahoma/scene.py b/custom_components/tahoma/scene.py index ef95e70b6..dd647e2d8 100644 --- a/custom_components/tahoma/scene.py +++ b/custom_components/tahoma/scene.py @@ -1,4 +1,4 @@ -"""Support for Tahoma scenes.""" +"""Support for TaHoma scenes.""" import logging from typing import Any @@ -10,7 +10,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma scenes from a config entry.""" + """Set up the TaHoma scenes from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -24,7 +24,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaScene(Scene): - """Representation of a Tahoma scene entity.""" + """Representation of a TaHoma scene entity.""" def __init__(self, tahoma_scene, controller): """Initialize the scene.""" diff --git a/custom_components/tahoma/sensor.py b/custom_components/tahoma/sensor.py index b9bba5289..8f37bf2c4 100644 --- a/custom_components/tahoma/sensor.py +++ b/custom_components/tahoma/sensor.py @@ -1,4 +1,4 @@ -"""Support for Tahoma sensors.""" +"""Support for TaHoma sensors.""" from datetime import timedelta import logging @@ -20,7 +20,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma sensors from a config entry.""" + """Set up the TaHoma sensors from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -35,7 +35,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaSensor(TahomaDevice, Entity): - """Representation of a Tahoma Sensor.""" + """Representation of a TaHoma Sensor.""" def __init__(self, tahoma_device, controller): """Initialize the sensor.""" diff --git a/custom_components/tahoma/strings.json b/custom_components/tahoma/strings.json index 1e6deadb4..2820a44e9 100644 --- a/custom_components/tahoma/strings.json +++ b/custom_components/tahoma/strings.json @@ -2,7 +2,7 @@ "config": { "step": { "user": { - "description": "Enter your tahoma credentials for the Tahoma App or the tahomalink.com platform.", + "description": "Enter your TaHoma credentials for the TaHoma App or the tahomalink.com platform.", "data": { "username": "[%key:common::config_flow::data::username%]", "password": "[%key:common::config_flow::data::password%]" diff --git a/custom_components/tahoma/switch.py b/custom_components/tahoma/switch.py index 1fd0dd967..248421307 100644 --- a/custom_components/tahoma/switch.py +++ b/custom_components/tahoma/switch.py @@ -1,4 +1,4 @@ -"""Support for Tahoma switches.""" +"""Support for TaHoma switches.""" import logging from homeassistant.components.switch import SwitchEntity @@ -12,7 +12,7 @@ async def async_setup_entry(hass, entry, async_add_entities): - """Set up the Tahoma sensors from a config entry.""" + """Set up the TaHoma sensors from a config entry.""" data = hass.data[DOMAIN][entry.entry_id] @@ -27,7 +27,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class TahomaSwitch(TahomaDevice, SwitchEntity): - """Representation a Tahoma Switch.""" + """Representation a TaHoma Switch.""" def __init__(self, tahoma_device, controller): """Initialize the switch.""" diff --git a/custom_components/tahoma/tahoma_api.py b/custom_components/tahoma/tahoma_api.py index 878a862e4..183d9207c 100644 --- a/custom_components/tahoma/tahoma_api.py +++ b/custom_components/tahoma/tahoma_api.py @@ -1,7 +1,7 @@ """ -Connection to Tahoma API. +Connection to TaHoma API. -Connection to Somfy Tahoma REST API +Connection to Somfy TaHoma REST API """ import json @@ -13,12 +13,12 @@ class TahomaApi: - """Connection to Tahoma API.""" + """Connection to TaHoma API.""" def __init__(self, userName, userPassword, **kwargs): - """Initalize the Tahoma protocol. + """Initalize the TaHoma protocol. - :param userName: Tahoma username + :param userName: TaHoma username :param userPassword: Password :param kwargs: Ignore, only for unit test reasons """ @@ -34,7 +34,7 @@ def __init__(self, userName, userPassword, **kwargs): self.login() def login(self): - """Login to Tahoma API.""" + """Login to TaHoma API.""" if self.__logged_in: return login = {'userId': self.__username, 'userPassword': self.__password} @@ -181,11 +181,11 @@ def _get_setup(self, result): @property def location(self): - """Return the location information stored in your Tahoma box. + """Return the location information stored in your TaHoma box. When the configuration has been loaded via get_setup this method retrieves all the location details which have - been saved for your Tahoma box. + been saved for your TaHoma box. :return: a dict with all the informations :rtype: dict :Example: @@ -218,10 +218,10 @@ def location(self): @property def gateway(self): - """Return information about your Tahoma box. + """Return information about your TaHoma box. When the configuration has been loaded via get_setup this - method retrieves all details your Tahoma box. + method retrieves all details your TaHoma box. :return: a list of all gateways with a dict per gateway with all the informations @@ -292,7 +292,7 @@ def apply_actions(self, name_of_action, actions): """Start to execute an action or a group of actions. This method takes a bunch of actions and runs them on your - Tahoma box. + TaHoma box. :param name_of_action: the label/name for the action :param actions: an array of Action objects @@ -526,10 +526,10 @@ def refresh_all_states(self): class Device: - """Represents an Tahoma Device.""" + """Represents an TaHoma Device.""" def __init__(self, protocol, dataInput): - """Initalize the Tahoma Device.""" + """Initalize the TaHoma Device.""" self.__protocol = protocol self.__raw_data = dataInput self.__active_states = {} @@ -696,10 +696,10 @@ def widget(self): class Action: - """Represents an Tahoma Action.""" + """Represents an TaHoma Action.""" def __init__(self, data): - """Initalize the Tahoma Action.""" + """Initalize the TaHoma Action.""" self.__commands = [] if isinstance(data, dict): @@ -765,10 +765,10 @@ def __repr__(self): class Command: - """Represents an Tahoma Command.""" + """Represents an TaHoma Command.""" def __init__(self, cmd_name, *args): - """Initalize the Tahoma Command.""" + """Initalize the TaHoma Command.""" self.__name = cmd_name if len(args): @@ -815,10 +815,10 @@ def __repr__(self): class ActionGroup: - """Represents an Tahoma Action Group.""" + """Represents an TaHoma Action Group.""" def __init__(self, data): - """Initalize the Tahoma Action Group.""" + """Initalize the TaHoma Action Group.""" if hasattr(data, 'lastUpdateTime'): self.__last_update = data['lastUpdateTime'] else: @@ -853,11 +853,11 @@ def actions(self): class Event: - """Represents an Tahoma Event.""" + """Represents an TaHoma Event.""" @staticmethod def factory(data): - """Tahoma Event factory.""" + """TaHoma Event factory.""" if data['name'] == "DeviceStateChangedEvent": return DeviceStateChangedEvent(data) elif data['name'] == "ExecutionStateChangedEvent": @@ -871,10 +871,10 @@ def factory(data): class DeviceStateChangedEvent(Event): - """Represents an Tahoma DeviceStateChangedEvent.""" + """Represents an TaHoma DeviceStateChangedEvent.""" def __init__(self, data): - """Initalize the Tahoma DeviceStateChangedEvent.""" + """Initalize the TaHoma DeviceStateChangedEvent.""" self.__device_url = data['deviceURL'] self.__states = data['deviceStates'] @@ -890,10 +890,10 @@ def states(self): class CommandExecutionStateChangedEvent(Event): - """Represents an Tahoma CommandExecutionStateChangedEvent.""" + """Represents an TaHoma CommandExecutionStateChangedEvent.""" def __init__(self, data): - """Initalize the Tahoma CommandExecutionStateChangedEvent.""" + """Initalize the TaHoma CommandExecutionStateChangedEvent.""" self.__exec_id = data['execId'] self.__device_url = data['deviceURL'] @@ -929,10 +929,10 @@ def failure_type(self): class ExecutionStateChangedEvent(Event): - """Represents an Tahoma ExecutionStateChangedEvent.""" + """Represents an TaHoma ExecutionStateChangedEvent.""" def __init__(self, data): - """Initalize the Tahoma ExecutionStateChangedEvent.""" + """Initalize the TaHoma ExecutionStateChangedEvent.""" self.__exec_id = data['execId'] try: @@ -970,10 +970,10 @@ def failure_device_url(self): class EventState(): - """Represents an Tahoma EventState.""" + """Represents an TaHoma EventState.""" def __init__(self, state): - """Initalize the Tahoma EventState.""" + """Initalize the TaHoma EventState.""" if isinstance(state, int): if state is EventState.Unknown0: self.__state = EventState.Unknown0 @@ -1041,10 +1041,10 @@ def __eq__(self, other): class Execution: - """Represents an Tahoma Execution.""" + """Represents an TaHoma Execution.""" def __init__(self, data): - """Initalize the Tahoma Execution.""" + """Initalize the TaHoma Execution.""" self.__execution_id = data['id'] self.__start_time = data['startTime'] self.__state = EventState(data['state']) diff --git a/custom_components/tahoma/tahoma_device.py b/custom_components/tahoma/tahoma_device.py index 8db1d37ad..74b514532 100644 --- a/custom_components/tahoma/tahoma_device.py +++ b/custom_components/tahoma/tahoma_device.py @@ -13,7 +13,7 @@ class TahomaDevice(Entity): - """Representation of a Tahoma device entity.""" + """Representation of a TaHoma device entity.""" def __init__(self, tahoma_device, controller): """Initialize the device.""" diff --git a/custom_components/tahoma/translations/en.json b/custom_components/tahoma/translations/en.json index 1e6deadb4..2820a44e9 100644 --- a/custom_components/tahoma/translations/en.json +++ b/custom_components/tahoma/translations/en.json @@ -2,7 +2,7 @@ "config": { "step": { "user": { - "description": "Enter your tahoma credentials for the Tahoma App or the tahomalink.com platform.", + "description": "Enter your TaHoma credentials for the TaHoma App or the tahomalink.com platform.", "data": { "username": "[%key:common::config_flow::data::username%]", "password": "[%key:common::config_flow::data::password%]"