Fix devolo switch on and off (#35357)

* use correct API set methods

* add devolo_home_control to coveragerc except config_flow.py
This commit is contained in:
Markus Bong 2020-05-08 21:41:56 +02:00 committed by GitHub
parent 0ac95fbed3
commit 62f2520ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -147,6 +147,9 @@ omit =
homeassistant/components/denon/media_player.py
homeassistant/components/denonavr/media_player.py
homeassistant/components/deutsche_bahn/sensor.py
homeassistant/components/devolo_home_control/__init__.py
homeassistant/components/devolo_home_control/const.py
homeassistant/components/devolo_home_control/switch.py
homeassistant/components/dht/sensor.py
homeassistant/components/digital_ocean/*
homeassistant/components/digitalloggers/switch.py

View File

@ -116,12 +116,12 @@ class DevoloSwitch(SwitchDevice):
def turn_on(self, **kwargs):
"""Switch on the device."""
self._is_on = True
self._binary_switch_property.set_binary_switch(state=True)
self._binary_switch_property.set(state=True)
def turn_off(self, **kwargs):
"""Switch off the device."""
self._is_on = False
self._binary_switch_property.set_binary_switch(state=False)
self._binary_switch_property.set(state=False)
def sync(self, message=None):
"""Update the binary switch state and consumption."""