HomeMatic optimizations and code cleanup (#7986)
* Cleanup and optimizations * Cleanup * Typo -.- * Linting
This commit is contained in:
parent
49d642741d
commit
a19e7ba3f1
5 changed files with 119 additions and 149 deletions
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
Support for Homematic switches.
|
||||
Support for HomeMatic switches.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/switch.homematic/
|
||||
|
@ -15,7 +15,7 @@ DEPENDENCIES = ['homematic']
|
|||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up the Homematic switch platform."""
|
||||
"""Set up the HomeMatic switch platform."""
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
||||
|
@ -29,7 +29,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
|
||||
|
||||
class HMSwitch(HMDevice, SwitchDevice):
|
||||
"""Representation of a Homematic switch."""
|
||||
"""Representation of a HomeMatic switch."""
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
|
@ -59,8 +59,7 @@ class HMSwitch(HMDevice, SwitchDevice):
|
|||
self._hmdevice.off(self._channel)
|
||||
|
||||
def _init_data_struct(self):
|
||||
"""Generate a data dict (self._data) from the Homematic metadata."""
|
||||
# Use STATE
|
||||
"""Generate the data dictionary (self._data) from metadata."""
|
||||
self._state = "STATE"
|
||||
self._data.update({self._state: STATE_UNKNOWN})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue