diff --git a/homeassistant/components/hdmi_cec.py b/homeassistant/components/hdmi_cec.py index 23c3fc01106..1b957e80c65 100644 --- a/homeassistant/components/hdmi_cec.py +++ b/homeassistant/components/hdmi_cec.py @@ -26,7 +26,7 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_START, STATE_UNKNOWN, from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity import Entity -REQUIREMENTS = ['pyCEC==0.4.9'] +REQUIREMENTS = ['pyCEC==0.4.11'] DOMAIN = 'hdmi_cec' diff --git a/homeassistant/components/switch/hdmi_cec.py b/homeassistant/components/switch/hdmi_cec.py index bd1f9ea6578..0e17aeab8e4 100644 --- a/homeassistant/components/switch/hdmi_cec.py +++ b/homeassistant/components/switch/hdmi_cec.py @@ -47,6 +47,14 @@ class CecSwitchDevice(CecDevice, SwitchDevice): self._device.turn_off() self._state = STATE_ON + def toggle(self): + """Toggle the entity.""" + self._device.toggle() + if self._state == STATE_ON: + self._state = STATE_OFF + else: + self._state = STATE_ON + @property def is_on(self) -> bool: """Return True if entity is on.""" diff --git a/requirements_all.txt b/requirements_all.txt index bace30c8fc8..08ef6b6d9c7 100755 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -381,7 +381,7 @@ pwaqi==1.3 py-cpuinfo==0.2.3 # homeassistant.components.hdmi_cec -pyCEC==0.4.9 +pyCEC==0.4.11 # homeassistant.components.switch.tplink pyHS100==0.2.3