diff --git a/custom_components/fan/smart_mi_fan.py b/custom_components/fan/smart_mi_fan.py index 9ac918c..87197ac 100644 --- a/custom_components/fan/smart_mi_fan.py +++ b/custom_components/fan/smart_mi_fan.py @@ -12,7 +12,7 @@ from homeassistant.components.fan import (SPEED_OFF, FanEntity, SUPPORT_SET_SPEE ATTR_SPEED, ATTR_SPEED_LIST, ATTR_OSCILLATING, ATTR_DIRECTION) from homeassistant.const import CONF_NAME, CONF_HOST, CONF_TOKEN -REQUIREMENTS = ['python-miio==0.0.8'] +REQUIREMENTS = ['python-miio==0.3.0'] _LOGGER = logging.getLogger(__name__) @@ -247,7 +247,7 @@ class SmartMiFan(FanEntity): import miio if not self._fan: _LOGGER.info("initializing with host %s token %s" % (self.host, self.token)) - self._fan = miio.device(self.host, self.token) + self._fan = miio.Device(self.host, self.token) return self._fan @property diff --git a/custom_components/switch/chuangmi_ir.py b/custom_components/switch/chuangmi_ir.py old mode 100644 new mode 100755 index 8c8f0d8..3064581 --- a/custom_components/switch/chuangmi_ir.py +++ b/custom_components/switch/chuangmi_ir.py @@ -18,14 +18,14 @@ from homeassistant.const import (CONF_SWITCHES, import homeassistant.helpers.config_validation as cv from homeassistant.util.dt import utcnow -REQUIREMENTS = ['python-miio==0.0.8'] +REQUIREMENTS = ['python-miio==0.3.0'] _LOGGER = logging.getLogger(__name__) DEVICE_DEFAULT_NAME = 'chuang_mi_ir' SWITCH_DEFAULT_NAME = 'chuang_mi_ir_switch' DOMAIN = "chuangmi" -DEFAULT_TIMEOUT = 10 +DEFAULT_TIMEOUT = 20 DEFAULT_RETRY = 3 SERVICE_LEARN = "learn_command" SERVICE_SEND = "send_packet" @@ -57,7 +57,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): @asyncio.coroutine def _learn_command(call): - ir_remote = miio.device(host, token) + ir_remote = miio.Device(host, token) if not ir_remote: _LOGGER.error("Failed to connect to device.") return @@ -86,7 +86,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): @asyncio.coroutine def _send_packet(call): - ir_remote = miio.device(host, token) + ir_remote = miio.Device(host, token) if not ir_remote: _LOGGER.error("Failed to connect to device.") return @@ -100,7 +100,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): except (socket.timeout, ValueError): _LOGGER.error("Failed to send packet to device.") - ir_remote = miio.device(host, token) + ir_remote = miio.Device(host, token) if not ir_remote: _LOGGER.error("Failed to connect to device.")