diff --git a/homeassistant/components/hdmi_cec.py b/homeassistant/components/hdmi_cec.py index 23c3fc011069e..1b957e80c6570 100644 --- a/homeassistant/components/hdmi_cec.py +++ b/homeassistant/components/hdmi_cec.py @@ -26,7 +26,7 @@ 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 bd1f9ea657877..0e17aeab8e42d 100644 --- a/homeassistant/components/switch/hdmi_cec.py +++ b/homeassistant/components/switch/hdmi_cec.py @@ -47,6 +47,14 @@ def turn_off(self, **kwargs) -> None: 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 bace30c8fc8b5..08ef6b6d9c702 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