Bump python-mirobo for improved device support and introduce API changes. (#9424)

This commit is contained in:
Sebastian Muszynski 2017-09-14 08:18:22 +02:00 committed by Paulus Schoutsen
parent ba5e8d133d
commit 5db55b306e
3 changed files with 10 additions and 10 deletions

View File

@ -28,7 +28,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})
REQUIREMENTS = ['python-mirobo==0.1.3']
REQUIREMENTS = ['python-mirobo==0.2.0']
# The light does not accept cct values < 1
CCT_MIN = 1
@ -163,7 +163,7 @@ class XiaomiPhilipsLight(Light):
result = yield from self._try_command(
"Setting brightness failed: %s",
self._light.set_bright, percent_brightness)
self._light.set_brightness, percent_brightness)
if result:
self._brightness = brightness
@ -181,7 +181,7 @@ class XiaomiPhilipsLight(Light):
result = yield from self._try_command(
"Setting color temperature failed: %s cct",
self._light.set_cct, percent_color_temp)
self._light.set_color_temperature, percent_color_temp)
if result:
self._color_temp = color_temp
@ -207,13 +207,13 @@ class XiaomiPhilipsLight(Light):
from mirobo import DeviceException
try:
state = yield from self.hass.async_add_job(self._light.status)
_LOGGER.debug("Got new state: %s", state.data)
_LOGGER.debug("Got new state: %s", state)
self._state = state.is_on
self._brightness = int(255 * 0.01 * state.bright)
self._color_temp = self.translate(state.cct, CCT_MIN, CCT_MAX,
self.max_mireds,
self.min_mireds)
self._brightness = int(255 * 0.01 * state.brightness)
self._color_temp = self.translate(state.color_temperature,
CCT_MIN, CCT_MAX,
self.max_mireds, self.min_mireds)
except DeviceException as 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)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['python-mirobo==0.1.3']
REQUIREMENTS = ['python-mirobo==0.2.0']
_LOGGER = logging.getLogger(__name__)

View File

@ -754,7 +754,7 @@ python-juicenet==0.0.5
# homeassistant.components.light.xiaomi_philipslight
# homeassistant.components.vacuum.xiaomi
python-mirobo==0.1.3
python-mirobo==0.2.0
# homeassistant.components.media_player.mpd
python-mpd2==0.5.5