diff --git a/custom_components/skykettle/light.py b/custom_components/skykettle/light.py index 6c5cdf4..a182142 100644 --- a/custom_components/skykettle/light.py +++ b/custom_components/skykettle/light.py @@ -4,7 +4,7 @@ from homeassistant.components.light import (ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ColorMode, LightEntity, LightEntityFeature) from homeassistant.const import CONF_FRIENDLY_NAME, STATE_OFF -from homeassistant.helpers.dispatcher import (async_dispatcher_connect, +from homeassistant.helpers.dispatcher import (dispatcher_connect, dispatcher_send) from homeassistant.helpers.entity import EntityCategory @@ -46,7 +46,7 @@ def __init__(self, hass, entry, light_type, n = 0): async def async_added_to_hass(self): self.update() - self.async_on_remove(async_dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) + self.async_on_remove(dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) def update(self): self.schedule_update_ha_state() diff --git a/custom_components/skykettle/manifest.json b/custom_components/skykettle/manifest.json index b83576c..fedc1d7 100644 --- a/custom_components/skykettle/manifest.json +++ b/custom_components/skykettle/manifest.json @@ -3,7 +3,7 @@ "name": "SkyKettle", "codeowners": ["@clusterm"], "config_flow": true, - "dependencies": ["bluetooth_adapters"], + "dependencies": ["bluetooth"], "documentation": "https://github.com/ClusterM/skykettle-ha/blob/master/README.md", "iot_class": "local_polling", "issue_tracker": "https://github.com/ClusterM/skykettle-ha/issues", diff --git a/custom_components/skykettle/number.py b/custom_components/skykettle/number.py index db7b18f..7f5f84e 100644 --- a/custom_components/skykettle/number.py +++ b/custom_components/skykettle/number.py @@ -4,8 +4,8 @@ from homeassistant.components.number import NumberEntity, NumberMode from homeassistant.const import (CONF_FRIENDLY_NAME, UnitOfTemperature, UnitOfTime) -from homeassistant.helpers.dispatcher import (async_dispatcher_connect, - async_dispatcher_send) +from homeassistant.helpers.dispatcher import (dispatcher_connect, + dispatcher_send) from homeassistant.helpers.entity import EntityCategory from .const import * @@ -47,7 +47,7 @@ def __init__(self, hass, entry, number_type): async def async_added_to_hass(self): self.update() - self.async_on_remove(async_dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) + self.async_on_remove(dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) def update(self): self.schedule_update_ha_state() @@ -242,4 +242,4 @@ async def async_set_native_value(self, value): await self.kettle.set_lamp_color_interval(value) if self.number_type == NUMBER_LAMP_AUTO_OFF_HOURS: await self.kettle.set_lamp_auto_off_hours(value) - self.hass.async_add_executor_job(async_dispatcher_send, self.hass, DISPATCHER_UPDATE) + self.hass.async_add_executor_job(dispatcher_send, self.hass, DISPATCHER_UPDATE) diff --git a/custom_components/skykettle/sensor.py b/custom_components/skykettle/sensor.py index d0625ca..b8114fb 100644 --- a/custom_components/skykettle/sensor.py +++ b/custom_components/skykettle/sensor.py @@ -5,7 +5,7 @@ SensorStateClass) from homeassistant.const import (CONF_FRIENDLY_NAME, PERCENTAGE, UnitOfEnergy, UnitOfTime) -from homeassistant.helpers.dispatcher import async_dispatcher_connect +from homeassistant.helpers.dispatcher import dispatcher_connect from homeassistant.helpers.entity import EntityCategory from .const import * @@ -48,7 +48,7 @@ def __init__(self, hass, entry, sensor_type): async def async_added_to_hass(self): self.update() - self.async_on_remove(async_dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) + self.async_on_remove(dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) def update(self): self.schedule_update_ha_state() diff --git a/custom_components/skykettle/switch.py b/custom_components/skykettle/switch.py index 32be54c..3123283 100644 --- a/custom_components/skykettle/switch.py +++ b/custom_components/skykettle/switch.py @@ -3,8 +3,8 @@ from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity from homeassistant.const import CONF_FRIENDLY_NAME -from homeassistant.helpers.dispatcher import (async_dispatcher_connect, - async_dispatcher_send) +from homeassistant.helpers.dispatcher import (dispatcher_connect, + dispatcher_send) from homeassistant.helpers.entity import EntityCategory from .const import * @@ -44,7 +44,7 @@ def __init__(self, hass, entry, switch_type): async def async_added_to_hass(self): self.update() - self.async_on_remove(async_dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) + self.async_on_remove(dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) def update(self): self.schedule_update_ha_state() @@ -140,7 +140,7 @@ async def async_turn_on(self, **kwargs): await self.kettle.set_light_switch(SkyKettle.LIGHT_SYNC, True) if self.switch_type == SWITCH_LIGHT_BOIL: await self.kettle.set_light_switch(SkyKettle.LIGHT_BOIL, True) - self.hass.async_add_executor_job(async_dispatcher_send, self.hass, DISPATCHER_UPDATE) + self.hass.async_add_executor_job(dispatcher_send, self.hass, DISPATCHER_UPDATE) async def async_turn_off(self, **kwargs): """Turn the switch off.""" @@ -152,4 +152,4 @@ async def async_turn_off(self, **kwargs): await self.kettle.set_light_switch(SkyKettle.LIGHT_SYNC, False) if self.switch_type == SWITCH_LIGHT_BOIL: await self.kettle.set_light_switch(SkyKettle.LIGHT_BOIL, False) - self.hass.async_add_executor_job(async_dispatcher_send, self.hass, DISPATCHER_UPDATE) + self.hass.async_add_executor_job(dispatcher_send, self.hass, DISPATCHER_UPDATE) diff --git a/custom_components/skykettle/water_heater.py b/custom_components/skykettle/water_heater.py index cdf3a8a..f975aa0 100644 --- a/custom_components/skykettle/water_heater.py +++ b/custom_components/skykettle/water_heater.py @@ -6,8 +6,8 @@ from homeassistant.const import (ATTR_SW_VERSION, ATTR_TEMPERATURE, CONF_FRIENDLY_NAME, CONF_SCAN_INTERVAL, STATE_OFF, UnitOfTemperature) -from homeassistant.helpers.dispatcher import (async_dispatcher_connect, - async_dispatcher_send) +from homeassistant.helpers.dispatcher import (dispatcher_connect, + dispatcher_send) from .const import * from .skykettle import SkyKettle @@ -30,7 +30,7 @@ def __init__(self, hass, entry): async def async_added_to_hass(self): self.update() - self.async_on_remove(async_dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) + self.async_on_remove(dispatcher_connect(self.hass, DISPATCHER_UPDATE, self.update)) def update(self): self.schedule_update_ha_state() @@ -175,9 +175,9 @@ async def async_set_temperature(self, **kwargs): """Set new target temperatures.""" target_temperature = kwargs.get(ATTR_TEMPERATURE) await self.kettle.set_target_temp(target_temperature) - self.hass.async_add_executor_job(async_dispatcher_send, self.hass, DISPATCHER_UPDATE) + self.hass.async_add_executor_job(dispatcher_send, self.hass, DISPATCHER_UPDATE) async def async_set_operation_mode(self, operation_mode): """Set new operation mode.""" await self.kettle.set_target_mode(operation_mode) - self.hass.async_add_executor_job(async_dispatcher_send, self.hass, DISPATCHER_UPDATE) + self.hass.async_add_executor_job(dispatcher_send, self.hass, DISPATCHER_UPDATE)