mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Clean up homematicip cloud (#22589)
* Code Cleanup - removed unused constants - more icons on binary_sensor groups - alligned code for device_state_attributes - fixed temperature unit origin for weather * removed icons
This commit is contained in:
parent
842a36dc9e
commit
5abfc84382
@ -12,9 +12,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
DEPENDENCIES = ['homematicip_cloud']
|
DEPENDENCIES = ['homematicip_cloud']
|
||||||
|
|
||||||
HMIP_ZONE_AWAY = 'EXTERNAL'
|
|
||||||
HMIP_ZONE_HOME = 'INTERNAL'
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
hass, config, async_add_entities, discovery_info=None):
|
hass, config, async_add_entities, discovery_info=None):
|
||||||
|
@ -10,8 +10,6 @@ from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
STATE_BOOST = 'Boost'
|
|
||||||
|
|
||||||
HA_STATE_TO_HMIP = {
|
HA_STATE_TO_HMIP = {
|
||||||
STATE_AUTO: 'AUTOMATIC',
|
STATE_AUTO: 'AUTOMATIC',
|
||||||
STATE_MANUAL: 'MANUAL',
|
STATE_MANUAL: 'MANUAL',
|
||||||
|
@ -13,7 +13,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
ATTR_ENERGY_COUNTER = 'energy_counter_kwh'
|
ATTR_ENERGY_COUNTER = 'energy_counter_kwh'
|
||||||
ATTR_POWER_CONSUMPTION = 'power_consumption'
|
ATTR_POWER_CONSUMPTION = 'power_consumption'
|
||||||
ATTR_PROFILE_MODE = 'profile_mode'
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
@ -77,13 +76,9 @@ class HomematicipLightMeasuring(HomematicipLight):
|
|||||||
"""Return the state attributes of the generic device."""
|
"""Return the state attributes of the generic device."""
|
||||||
attr = super().device_state_attributes
|
attr = super().device_state_attributes
|
||||||
if self._device.currentPowerConsumption > 0.05:
|
if self._device.currentPowerConsumption > 0.05:
|
||||||
attr.update({
|
attr[ATTR_POWER_CONSUMPTION] = \
|
||||||
ATTR_POWER_CONSUMPTION:
|
round(self._device.currentPowerConsumption, 2)
|
||||||
round(self._device.currentPowerConsumption, 2)
|
attr[ATTR_ENERGY_COUNTER] = round(self._device.energyCounter, 2)
|
||||||
})
|
|
||||||
attr.update({
|
|
||||||
ATTR_ENERGY_COUNTER: round(self._device.energyCounter, 2)
|
|
||||||
})
|
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
|
|
||||||
@ -168,10 +163,7 @@ class HomematicipNotificationLight(HomematicipGenericDevice, Light):
|
|||||||
"""Return the state attributes of the generic device."""
|
"""Return the state attributes of the generic device."""
|
||||||
attr = super().device_state_attributes
|
attr = super().device_state_attributes
|
||||||
if self.is_on:
|
if self.is_on:
|
||||||
attr.update({
|
attr[ATTR_COLOR_NAME] = self._channel.simpleRGBColorState
|
||||||
ATTR_COLOR_NAME:
|
|
||||||
self._channel.simpleRGBColorState
|
|
||||||
})
|
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -12,8 +12,6 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
DEPENDENCIES = ['homematicip_cloud']
|
DEPENDENCIES = ['homematicip_cloud']
|
||||||
|
|
||||||
ATTR_TEMPERATURE_OFFSET = 'temperature_offset'
|
ATTR_TEMPERATURE_OFFSET = 'temperature_offset'
|
||||||
ATTR_VALVE_STATE = 'valve_state'
|
|
||||||
ATTR_VALVE_POSITION = 'valve_position'
|
|
||||||
ATTR_WIND_DIRECTION = 'wind_direction'
|
ATTR_WIND_DIRECTION = 'wind_direction'
|
||||||
ATTR_WIND_DIRECTION_VARIATION = 'wind_direction_variation_in_degree'
|
ATTR_WIND_DIRECTION_VARIATION = 'wind_direction_variation_in_degree'
|
||||||
|
|
||||||
|
@ -10,10 +10,6 @@ DEPENDENCIES = ['homematicip_cloud']
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
ATTR_POWER_CONSUMPTION = 'power_consumption'
|
|
||||||
ATTR_ENERGIE_COUNTER = 'energie_counter'
|
|
||||||
ATTR_PROFILE_MODE = 'profile_mode'
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_platform(
|
async def async_setup_platform(
|
||||||
hass, config, async_add_entities, discovery_info=None):
|
hass, config, async_add_entities, discovery_info=None):
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.weather import WeatherEntity
|
from homeassistant.components.weather import WeatherEntity
|
||||||
|
from homeassistant.const import TEMP_CELSIUS
|
||||||
|
|
||||||
from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
|
from . import DOMAIN as HMIPC_DOMAIN, HMIPC_HAPID, HomematicipGenericDevice
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ class HomematicipWeatherSensor(HomematicipGenericDevice, WeatherEntity):
|
|||||||
@property
|
@property
|
||||||
def temperature_unit(self):
|
def temperature_unit(self):
|
||||||
"""Return the unit of measurement."""
|
"""Return the unit of measurement."""
|
||||||
return self.hass.config.units.temperature_unit
|
return TEMP_CELSIUS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def humidity(self):
|
def humidity(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user