Fix mysensors version errors
* The application of the version check in unit_of_measurement was messed up after the last refactor. Fix that again. * An error could occur in device_state_attributes if there was a mismatch between used value_type in the device and mysensors version in config. Add try... except to handle that. Bump pyvera version. Bump pywemo version. Add unavailable status before properly initialised for maker and insight.
This commit is contained in:
parent
d38ad57b7d
commit
d773ad1ecb
5 changed files with 18 additions and 6 deletions
|
@ -15,7 +15,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS
|
|||
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, STATE_ON
|
||||
|
||||
REQUIREMENTS = ['pyvera==0.2.7']
|
||||
REQUIREMENTS = ['pyvera==0.2.8']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from homeassistant.const import (
|
|||
ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME,
|
||||
TEMP_CELCIUS, TEMP_FAHRENHEIT, EVENT_HOMEASSISTANT_STOP)
|
||||
|
||||
REQUIREMENTS = ['pyvera==0.2.7']
|
||||
REQUIREMENTS = ['pyvera==0.2.8']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from homeassistant.const import (
|
|||
STATE_ON,
|
||||
STATE_OFF)
|
||||
|
||||
REQUIREMENTS = ['pyvera==0.2.7']
|
||||
REQUIREMENTS = ['pyvera==0.2.8']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.components.switch import SwitchDevice
|
|||
from homeassistant.const import (
|
||||
STATE_ON, STATE_OFF, STATE_STANDBY, EVENT_HOMEASSISTANT_STOP)
|
||||
|
||||
REQUIREMENTS = ['pywemo==0.3.8']
|
||||
REQUIREMENTS = ['pywemo==0.3.9']
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
_WEMO_SUBSCRIPTION_REGISTRY = None
|
||||
|
@ -153,6 +153,18 @@ class WemoSwitch(SwitchDevice):
|
|||
""" True if switch is on. """
|
||||
return self.wemo.get_state()
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
""" True if switch is available. """
|
||||
if (self.wemo.model_name == 'Insight' and
|
||||
self.insight_params is None):
|
||||
return False
|
||||
|
||||
if (self.wemo.model_name == 'Maker' and
|
||||
self.maker_params is None):
|
||||
return False
|
||||
return True
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
""" Turns the switch on. """
|
||||
self.wemo.on()
|
||||
|
|
|
@ -196,10 +196,10 @@ pyuserinput==0.1.9
|
|||
# homeassistant.components.light.vera
|
||||
# homeassistant.components.sensor.vera
|
||||
# homeassistant.components.switch.vera
|
||||
pyvera==0.2.7
|
||||
pyvera==0.2.8
|
||||
|
||||
# homeassistant.components.switch.wemo
|
||||
pywemo==0.3.8
|
||||
pywemo==0.3.9
|
||||
|
||||
# homeassistant.components.thermostat.radiotherm
|
||||
radiotherm==1.2
|
||||
|
|
Loading…
Add table
Reference in a new issue