From f429a6c4ffe8a0a8352e72e544104eeff768c66b Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Mon, 15 Feb 2016 18:59:11 +0100 Subject: [PATCH] Add assumed_state for rfxtrx switch and light. --- homeassistant/components/light/rfxtrx.py | 6 ++++++ homeassistant/components/switch/rfxtrx.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/homeassistant/components/light/rfxtrx.py b/homeassistant/components/light/rfxtrx.py index 08f3dcc7c60..91419ed6b0f 100644 --- a/homeassistant/components/light/rfxtrx.py +++ b/homeassistant/components/light/rfxtrx.py @@ -152,6 +152,12 @@ class RfxtrxLight(Light): """ Brightness of this light between 0..255. """ return self._brightness + @property + def assumed_state(self): + """Return True if unable to access real state of entity.""" + return True + + def turn_on(self, **kwargs): """ Turn the light on. """ brightness = kwargs.get(ATTR_BRIGHTNESS) diff --git a/homeassistant/components/switch/rfxtrx.py b/homeassistant/components/switch/rfxtrx.py index b3d19a5db3b..5a90db77b5b 100644 --- a/homeassistant/components/switch/rfxtrx.py +++ b/homeassistant/components/switch/rfxtrx.py @@ -132,6 +132,11 @@ class RfxtrxSwitch(SwitchDevice): """ True if light is on. """ return self._state + @property + def assumed_state(self): + """Return True if unable to access real state of entity.""" + return True + def turn_on(self, **kwargs): """ Turn the device on. """ if self._event: