Minor updates (#16106)
This commit is contained in:
1 parent
1ce51bfbd6
commit
0e1fb74e1b
20 files changed
+172
-180
No files matched your search
@@ -5,8 +5,9 @@ For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/switch.homematic/
|
||||
"""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.homematic import ATTR_DISCOVER_DEVICES, HMDevice
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
from homeassistant.components.homematic import HMDevice, ATTR_DISCOVER_DEVICES
|
||||
from homeassistant.const import STATE_UNKNOWN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
"""
|
||||
Support for HomematicIP switch.
|
||||
Support for HomematicIP Cloud switch.
|
||||
|
||||
For more details about this component, please refer to the documentation at
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/switch.homematicip_cloud/
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
from homeassistant.components.homematicip_cloud import (
|
||||
HomematicipGenericDevice, DOMAIN as HMIPC_DOMAIN,
|
||||
HMIPC_HAPID)
|
||||
HMIPC_HAPID, HomematicipGenericDevice)
|
||||
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
|
||||
DEPENDENCIES = ['homematicip_cloud']
|
||||
|
||||
@@ -21,17 +20,16 @@ ATTR_ENERGIE_COUNTER = 'energie_counter'
|
||||
ATTR_PROFILE_MODE = 'profile_mode'
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_devices,
|
||||
discovery_info=None):
|
||||
"""Set up the HomematicIP switch devices."""
|
||||
async def async_setup_platform(
|
||||
hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the HomematicIP Cloud switch devices."""
|
||||
pass
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry, async_add_devices):
|
||||
"""Set up the HomematicIP switch from a config entry."""
|
||||
from homematicip.device import (
|
||||
PlugableSwitch, PlugableSwitchMeasuring,
|
||||
BrandSwitchMeasuring)
|
||||
PlugableSwitch, PlugableSwitchMeasuring, BrandSwitchMeasuring)
|
||||
|
||||
home = hass.data[HMIPC_DOMAIN][config_entry.data[HMIPC_HAPID]].home
|
||||
devices = []
|
||||
@@ -51,7 +49,7 @@ async def async_setup_entry(hass, config_entry, async_add_devices):
|
||||
|
||||
|
||||
class HomematicipSwitch(HomematicipGenericDevice, SwitchDevice):
|
||||
"""MomematicIP switch device."""
|
||||
"""representation of a HomematicIP Cloud switch device."""
|
||||
|
||||
def __init__(self, home, device):
|
||||
"""Initialize the switch device."""
|
||||
@@ -72,7 +70,7 @@ class HomematicipSwitch(HomematicipGenericDevice, SwitchDevice):
|
||||
|
||||
|
||||
class HomematicipSwitchMeasuring(HomematicipSwitch):
|
||||
"""MomematicIP measuring switch device."""
|
||||
"""Representation of a HomematicIP measuring switch device."""
|
||||
|
||||
@property
|
||||
def current_power_w(self):
|
||||
|
||||
Reference in new issue
Block a user