Bump python-miio for improved device support (#10294)

* Bump python-miio for improved device support.

* Requirements defines updated.
pull/10291/merge
Sebastian Muszynski 2017-11-02 21:38:18 +01:00 committed by Pascal Vizeli
parent 5359001c04
commit f2a38677fc
5 changed files with 13 additions and 9 deletions

View File

@ -31,7 +31,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
}) })
REQUIREMENTS = ['python-miio==0.3.0'] REQUIREMENTS = ['python-miio==0.3.1']
ATTR_TEMPERATURE = 'temperature' ATTR_TEMPERATURE = 'temperature'
ATTR_HUMIDITY = 'humidity' ATTR_HUMIDITY = 'humidity'

View File

@ -28,7 +28,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
}) })
REQUIREMENTS = ['python-miio==0.3.0'] REQUIREMENTS = ['python-miio==0.3.1']
# The light does not accept cct values < 1 # The light does not accept cct values < 1
CCT_MIN = 1 CCT_MIN = 1
@ -70,8 +70,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
device = XiaomiPhilipsCeilingLamp(name, light, device_info) device = XiaomiPhilipsCeilingLamp(name, light, device_info)
devices.append(device) devices.append(device)
elif device_info.model == 'philips.light.bulb': elif device_info.model == 'philips.light.bulb':
from miio import Ceil from miio import PhilipsBulb
light = Ceil(host, token) light = PhilipsBulb(host, token)
device = XiaomiPhilipsLightBall(name, light, device_info) device = XiaomiPhilipsLightBall(name, light, device_info)
devices.append(device) devices.append(device)
else: else:

View File

@ -25,7 +25,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
}) })
REQUIREMENTS = ['python-miio==0.3.0'] REQUIREMENTS = ['python-miio==0.3.1']
ATTR_POWER = 'power' ATTR_POWER = 'power'
ATTR_TEMPERATURE = 'temperature' ATTR_TEMPERATURE = 'temperature'
@ -68,8 +68,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
elif device_info.model in ['qmi.powerstrip.v1', elif device_info.model in ['qmi.powerstrip.v1',
'zimi.powerstrip.v2']: 'zimi.powerstrip.v2']:
from miio import Strip from miio import PowerStrip
plug = Strip(host, token) plug = PowerStrip(host, token)
device = XiaomiPowerStripSwitch(name, plug, device_info) device = XiaomiPowerStripSwitch(name, plug, device_info)
devices.append(device) devices.append(device)
elif device_info.model in ['chuangmi.plug.m1', elif device_info.model in ['chuangmi.plug.m1',
@ -288,5 +288,9 @@ class ChuangMiPlugV1Switch(XiaomiPlugGenericSwitch, SwitchDevice):
else: else:
self._state = state.is_on self._state = state.is_on
self._state_attrs.update({
ATTR_TEMPERATURE: state.temperature
})
except DeviceException as ex: except DeviceException as ex:
_LOGGER.error("Got exception while fetching the state: %s", ex) _LOGGER.error("Got exception while fetching the state: %s", ex)

View File

@ -21,7 +21,7 @@ from homeassistant.const import (
ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON) ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['python-miio==0.3.0'] REQUIREMENTS = ['python-miio==0.3.1']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -832,7 +832,7 @@ python-juicenet==0.0.5
# homeassistant.components.light.xiaomi_miio # homeassistant.components.light.xiaomi_miio
# homeassistant.components.switch.xiaomi_miio # homeassistant.components.switch.xiaomi_miio
# homeassistant.components.vacuum.xiaomi_miio # homeassistant.components.vacuum.xiaomi_miio
python-miio==0.3.0 python-miio==0.3.1
# homeassistant.components.media_player.mpd # homeassistant.components.media_player.mpd
python-mpd2==0.5.5 python-mpd2==0.5.5