From 2f1d30fa8509dac21c08a4caa18d336311b00d81 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Wed, 4 Nov 2020 21:59:08 +0100 Subject: [PATCH 1/8] Bump hatasmota to 0.0.25.1 (#42850) --- .../components/tasmota/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/tasmota/test_common.py | 38 +++++++++++++++++++ tests/components/tasmota/test_discovery.py | 25 +++++++++++- 5 files changed, 65 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tasmota/manifest.json b/homeassistant/components/tasmota/manifest.json index b087e13ece0..a0414b6450b 100644 --- a/homeassistant/components/tasmota/manifest.json +++ b/homeassistant/components/tasmota/manifest.json @@ -3,7 +3,7 @@ "name": "Tasmota (beta)", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/tasmota", - "requirements": ["hatasmota==0.0.25"], + "requirements": ["hatasmota==0.0.25.1"], "dependencies": ["mqtt"], "mqtt": ["tasmota/discovery/#"], "codeowners": ["@emontnemery"] diff --git a/requirements_all.txt b/requirements_all.txt index c5249892b15..7504b10e9e2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -732,7 +732,7 @@ hass-nabucasa==0.37.1 hass_splunk==0.1.1 # homeassistant.components.tasmota -hatasmota==0.0.25 +hatasmota==0.0.25.1 # homeassistant.components.jewish_calendar hdate==0.9.12 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 6a172830d5c..2e74a82e8c4 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -367,7 +367,7 @@ hangups==0.4.11 hass-nabucasa==0.37.1 # homeassistant.components.tasmota -hatasmota==0.0.25 +hatasmota==0.0.25.1 # homeassistant.components.jewish_calendar hdate==0.9.12 diff --git a/tests/components/tasmota/test_common.py b/tests/components/tasmota/test_common.py index 5c18f2f401c..665249f312a 100644 --- a/tests/components/tasmota/test_common.py +++ b/tests/components/tasmota/test_common.py @@ -58,6 +58,44 @@ DEFAULT_CONFIG = { } +DEFAULT_CONFIG_9_0_0_4 = { + "ip": "192.168.15.10", + "dn": "Tasmota", + "fn": ["Test", "Beer", "Milk", "Four", None], + "hn": "tasmota_49A3BC-0956", + "if": 0, # iFan + "lk": 1, # RGB + white channels linked to a single light + "mac": "00000049A3BC", + "md": "Sonoff Basic", + "ofln": "Offline", + "onln": "Online", + "state": ["OFF", "ON", "TOGGLE", "HOLD"], + "sw": "8.4.0.2", + "swn": [None, None, None, None, None], + "t": "tasmota_49A3BC", + "ft": "%topic%/%prefix%/", + "tp": ["cmnd", "stat", "tele"], + "rl": [0, 0, 0, 0, 0, 0, 0, 0], + "swc": [-1, -1, -1, -1, -1, -1, -1, -1], + "btn": [0, 0, 0, 0], + "so": { + "4": 0, # Return MQTT response as RESULT or %COMMAND% + "11": 0, # Swap button single and double press functionality + "13": 0, # Allow immediate action on single button press + "17": 1, # Show Color string as hex or comma-separated + "20": 0, # Update of Dimmer/Color/CT without turning power on + "30": 0, # Enforce Home Assistant auto-discovery as light + "68": 0, # Multi-channel PWM instead of a single light + "73": 0, # Enable Buttons decoupling and send multi-press and hold MQTT messages + "82": 0, # Reduce the CT range from 153..500 to 200.380 + "114": 0, # Enable sending switch MQTT messages + }, + "ty": 0, # Tuya MCU + "lt_st": 0, + "ver": 1, +} + + async def help_test_availability_when_connection_lost( hass, mqtt_client_mock, diff --git a/tests/components/tasmota/test_discovery.py b/tests/components/tasmota/test_discovery.py index 607676615a7..ba288ef93ae 100644 --- a/tests/components/tasmota/test_discovery.py +++ b/tests/components/tasmota/test_discovery.py @@ -6,7 +6,7 @@ from homeassistant.components.tasmota.const import DEFAULT_PREFIX from homeassistant.components.tasmota.discovery import ALREADY_DISCOVERED from .conftest import setup_tasmota_helper -from .test_common import DEFAULT_CONFIG +from .test_common import DEFAULT_CONFIG, DEFAULT_CONFIG_9_0_0_4 from tests.async_mock import patch from tests.common import async_fire_mqtt_message @@ -132,6 +132,29 @@ async def test_device_discover( assert device_entry.sw_version == config["sw"] +async def test_device_discover_deprecated( + hass, mqtt_mock, caplog, device_reg, entity_reg, setup_tasmota +): + """Test setting up a device with deprecated discovery message.""" + config = copy.deepcopy(DEFAULT_CONFIG_9_0_0_4) + mac = config["mac"] + + async_fire_mqtt_message( + hass, + f"{DEFAULT_PREFIX}/{mac}/config", + json.dumps(config), + ) + await hass.async_block_till_done() + + # Verify device and registry entries are created + device_entry = device_reg.async_get_device(set(), {("mac", mac)}) + assert device_entry is not None + assert device_entry.manufacturer == "Tasmota" + assert device_entry.model == config["md"] + assert device_entry.name == config["dn"] + assert device_entry.sw_version == config["sw"] + + async def test_device_update( hass, mqtt_mock, caplog, device_reg, entity_reg, setup_tasmota ): From ba48fd6c517a1f52d4d5b0ceedf7c93b89659dd1 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Wed, 4 Nov 2020 11:41:08 -0700 Subject: [PATCH 2/8] Clean up SimpliSafe binary sensor implementation (#42841) * Clean up SimpliSafe binary sensor implementation * Cleanup * Constant name --- .../components/simplisafe/binary_sensor.py | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/homeassistant/components/simplisafe/binary_sensor.py b/homeassistant/components/simplisafe/binary_sensor.py index 263bbf51b13..67a4af4752d 100644 --- a/homeassistant/components/simplisafe/binary_sensor.py +++ b/homeassistant/components/simplisafe/binary_sensor.py @@ -23,25 +23,25 @@ SUPPORTED_BATTERY_SENSOR_TYPES = [ EntityTypes.temperature, ] -SUPPORTED_SENSOR_TYPES = [ - EntityTypes.entry, +SUPPORTED_TRIGGERED_SENSOR_TYPES = [ EntityTypes.carbon_monoxide, - EntityTypes.smoke, + EntityTypes.entry, EntityTypes.leak, + EntityTypes.smoke, ] -HA_SENSOR_TYPES = { - EntityTypes.entry: DEVICE_CLASS_DOOR, +DEVICE_CLASSES = { EntityTypes.carbon_monoxide: DEVICE_CLASS_GAS, - EntityTypes.smoke: DEVICE_CLASS_SMOKE, + EntityTypes.entry: DEVICE_CLASS_DOOR, EntityTypes.leak: DEVICE_CLASS_MOISTURE, + EntityTypes.smoke: DEVICE_CLASS_SMOKE, } SENSOR_MODELS = { - EntityTypes.entry: "Entry Sensor", EntityTypes.carbon_monoxide: "Carbon Monoxide Detector", - EntityTypes.smoke: "Smoke Detector", + EntityTypes.entry: "Entry Sensor", EntityTypes.leak: "Water Sensor", + EntityTypes.smoke: "Smoke Detector", } @@ -56,10 +56,10 @@ async def async_setup_entry(hass, entry, async_add_entities): continue for sensor in system.sensors.values(): - if sensor.type in SUPPORTED_SENSOR_TYPES: - sensors.append(SimpliSafeBinarySensor(simplisafe, system, sensor)) + if sensor.type in SUPPORTED_TRIGGERED_SENSOR_TYPES: + sensors.append(TriggeredBinarySensor(simplisafe, system, sensor)) if sensor.type in SUPPORTED_BATTERY_SENSOR_TYPES: - sensors.append(SimpliSafeSensorBattery(simplisafe, system, sensor)) + sensors.append(BatteryBinarySensor(simplisafe, system, sensor)) async_add_entities(sensors) @@ -70,6 +70,17 @@ class SimpliSafeBinarySensor(SimpliSafeEntity, BinarySensorEntity): def __init__(self, simplisafe, system, sensor): """Initialize.""" super().__init__(simplisafe, system, sensor.name, serial=sensor.serial) + self._device_info["identifiers"] = {(DOMAIN, sensor.serial)} + self._device_info["model"] = SENSOR_MODELS[sensor.type] + self._device_info["name"] = sensor.name + + +class TriggeredBinarySensor(SimpliSafeBinarySensor): + """Define a binary sensor related to whether an entity has been triggered.""" + + def __init__(self, simplisafe, system, sensor): + """Initialize.""" + super().__init__(simplisafe, system, sensor) self._system = system self._sensor = sensor self._is_on = False @@ -77,16 +88,7 @@ class SimpliSafeBinarySensor(SimpliSafeEntity, BinarySensorEntity): @property def device_class(self): """Return type of sensor.""" - return HA_SENSOR_TYPES[self._sensor.type] - - @property - def device_info(self): - """Return device registry information for this entity.""" - info = super().device_info - info["identifiers"] = {(DOMAIN, self._sensor.serial)} - info["model"] = SENSOR_MODELS[self._sensor.type] - info["name"] = self._sensor.name - return info + return DEVICE_CLASSES[self._sensor.type] @property def is_on(self): @@ -99,19 +101,15 @@ class SimpliSafeBinarySensor(SimpliSafeEntity, BinarySensorEntity): self._is_on = self._sensor.triggered -class SimpliSafeSensorBattery(SimpliSafeEntity, BinarySensorEntity): +class BatteryBinarySensor(SimpliSafeEntity, BinarySensorEntity): """Define a SimpliSafe battery binary sensor entity.""" def __init__(self, simplisafe, system, sensor): """Initialize.""" - super().__init__(simplisafe, system, sensor.name, serial=sensor.serial) + super().__init__(simplisafe, system, sensor) self._sensor = sensor self._is_low = False - self._device_info["identifiers"] = {(DOMAIN, sensor.serial)} - self._device_info["model"] = SENSOR_MODELS[sensor.type] - self._device_info["name"] = sensor.name - @property def device_class(self): """Return type of sensor.""" From 943cc243b5e8af4b0ed0d18b92e8ef369dbd718a Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Wed, 4 Nov 2020 12:34:14 -0700 Subject: [PATCH 3/8] Fix missing sensor exceptions in SimpliSafe (#42845) * Fix missing sensor exceptions in SimpliSafe * Entity types * Don't overdo it --- .../components/simplisafe/__init__.py | 12 +++++ .../components/simplisafe/binary_sensor.py | 52 ++++++------------- homeassistant/components/simplisafe/sensor.py | 11 ++-- 3 files changed, 31 insertions(+), 44 deletions(-) diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index a3f56a9e1a3..1389c1d1f08 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -724,3 +724,15 @@ class SimpliSafeEntity(CoordinatorEntity): @callback def async_update_from_websocket_event(self, event): """Update the entity with the provided websocket event.""" + + +class SimpliSafeBaseSensor(SimpliSafeEntity): + """Define a SimpliSafe base (binary) sensor.""" + + def __init__(self, simplisafe, system, sensor): + """Initialize.""" + super().__init__(simplisafe, system, sensor.name, serial=sensor.serial) + self._device_info["identifiers"] = {(DOMAIN, sensor.serial)} + self._device_info["model"] = sensor.type.name + self._device_info["name"] = sensor.name + self._sensor = sensor diff --git a/homeassistant/components/simplisafe/binary_sensor.py b/homeassistant/components/simplisafe/binary_sensor.py index 67a4af4752d..aa0132cb330 100644 --- a/homeassistant/components/simplisafe/binary_sensor.py +++ b/homeassistant/components/simplisafe/binary_sensor.py @@ -11,7 +11,7 @@ from homeassistant.components.binary_sensor import ( ) from homeassistant.core import callback -from . import SimpliSafeEntity +from . import SimpliSafeBaseSensor from .const import DATA_CLIENT, DOMAIN, LOGGER SUPPORTED_BATTERY_SENSOR_TYPES = [ @@ -23,27 +23,13 @@ SUPPORTED_BATTERY_SENSOR_TYPES = [ EntityTypes.temperature, ] -SUPPORTED_TRIGGERED_SENSOR_TYPES = [ - EntityTypes.carbon_monoxide, - EntityTypes.entry, - EntityTypes.leak, - EntityTypes.smoke, -] - -DEVICE_CLASSES = { +TRIGGERED_SENSOR_TYPES = { EntityTypes.carbon_monoxide: DEVICE_CLASS_GAS, EntityTypes.entry: DEVICE_CLASS_DOOR, EntityTypes.leak: DEVICE_CLASS_MOISTURE, EntityTypes.smoke: DEVICE_CLASS_SMOKE, } -SENSOR_MODELS = { - EntityTypes.carbon_monoxide: "Carbon Monoxide Detector", - EntityTypes.entry: "Entry Sensor", - EntityTypes.leak: "Water Sensor", - EntityTypes.smoke: "Smoke Detector", -} - async def async_setup_entry(hass, entry, async_add_entities): """Set up SimpliSafe binary sensors based on a config entry.""" @@ -56,39 +42,34 @@ async def async_setup_entry(hass, entry, async_add_entities): continue for sensor in system.sensors.values(): - if sensor.type in SUPPORTED_TRIGGERED_SENSOR_TYPES: - sensors.append(TriggeredBinarySensor(simplisafe, system, sensor)) + if sensor.type in TRIGGERED_SENSOR_TYPES: + sensors.append( + TriggeredBinarySensor( + simplisafe, + system, + sensor, + TRIGGERED_SENSOR_TYPES[sensor.type], + ) + ) if sensor.type in SUPPORTED_BATTERY_SENSOR_TYPES: sensors.append(BatteryBinarySensor(simplisafe, system, sensor)) async_add_entities(sensors) -class SimpliSafeBinarySensor(SimpliSafeEntity, BinarySensorEntity): - """Define a SimpliSafe binary sensor entity.""" - - def __init__(self, simplisafe, system, sensor): - """Initialize.""" - super().__init__(simplisafe, system, sensor.name, serial=sensor.serial) - self._device_info["identifiers"] = {(DOMAIN, sensor.serial)} - self._device_info["model"] = SENSOR_MODELS[sensor.type] - self._device_info["name"] = sensor.name - - -class TriggeredBinarySensor(SimpliSafeBinarySensor): +class TriggeredBinarySensor(SimpliSafeBaseSensor, BinarySensorEntity): """Define a binary sensor related to whether an entity has been triggered.""" - def __init__(self, simplisafe, system, sensor): + def __init__(self, simplisafe, system, sensor, device_class): """Initialize.""" super().__init__(simplisafe, system, sensor) - self._system = system - self._sensor = sensor + self._device_class = device_class self._is_on = False @property def device_class(self): """Return type of sensor.""" - return DEVICE_CLASSES[self._sensor.type] + return self._device_class @property def is_on(self): @@ -101,13 +82,12 @@ class TriggeredBinarySensor(SimpliSafeBinarySensor): self._is_on = self._sensor.triggered -class BatteryBinarySensor(SimpliSafeEntity, BinarySensorEntity): +class BatteryBinarySensor(SimpliSafeBaseSensor, BinarySensorEntity): """Define a SimpliSafe battery binary sensor entity.""" def __init__(self, simplisafe, system, sensor): """Initialize.""" super().__init__(simplisafe, system, sensor) - self._sensor = sensor self._is_low = False @property diff --git a/homeassistant/components/simplisafe/sensor.py b/homeassistant/components/simplisafe/sensor.py index 5909471c455..7e927ee942e 100644 --- a/homeassistant/components/simplisafe/sensor.py +++ b/homeassistant/components/simplisafe/sensor.py @@ -4,7 +4,7 @@ from simplipy.entity import EntityTypes from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_FAHRENHEIT from homeassistant.core import callback -from . import SimpliSafeEntity +from . import SimpliSafeBaseSensor from .const import DATA_CLIENT, DOMAIN, LOGGER @@ -25,19 +25,14 @@ async def async_setup_entry(hass, entry, async_add_entities): async_add_entities(sensors) -class SimplisafeFreezeSensor(SimpliSafeEntity): +class SimplisafeFreezeSensor(SimpliSafeBaseSensor): """Define a SimpliSafe freeze sensor entity.""" def __init__(self, simplisafe, system, sensor): """Initialize.""" - super().__init__(simplisafe, system, sensor.name, serial=sensor.serial) - self._sensor = sensor + super().__init__(simplisafe, system, sensor) self._state = None - self._device_info["identifiers"] = {(DOMAIN, sensor.serial)} - self._device_info["model"] = "Freeze Sensor" - self._device_info["name"] = sensor.name - @property def device_class(self): """Return type of sensor.""" From 7c084975b72d52e6015ce6103949b01a8573b5f3 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Wed, 4 Nov 2020 18:59:54 -0700 Subject: [PATCH 4/8] Fix missing/incorrect SimpliSafe entities (#42846) * Entity types * Don't overdo it * Fix missing/incorrect SimpliSafe entities --- .../components/simplisafe/__init__.py | 20 ++++++++++++++++--- .../components/simplisafe/binary_sensor.py | 6 +++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index 1389c1d1f08..f71e69d9aab 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -3,6 +3,7 @@ import asyncio from uuid import UUID from simplipy import API +from simplipy.entity import EntityTypes from simplipy.errors import EndpointUnavailable, InvalidCredentialsError, SimplipyError from simplipy.websocket import ( EVENT_CAMERA_MOTION_DETECTED, @@ -590,6 +591,13 @@ class SimpliSafeEntity(CoordinatorEntity): else: self._serial = system.serial + try: + sensor_type = EntityTypes( + simplisafe.initial_event_to_use[system.system_id].get("sensorType") + ) + except ValueError: + sensor_type = EntityTypes.unknown + self._attrs = { ATTR_LAST_EVENT_INFO: simplisafe.initial_event_to_use[system.system_id].get( "info" @@ -597,9 +605,7 @@ class SimpliSafeEntity(CoordinatorEntity): ATTR_LAST_EVENT_SENSOR_NAME: simplisafe.initial_event_to_use[ system.system_id ].get("sensorName"), - ATTR_LAST_EVENT_SENSOR_TYPE: simplisafe.initial_event_to_use[ - system.system_id - ].get("sensorType"), + ATTR_LAST_EVENT_SENSOR_TYPE: sensor_type.name, ATTR_LAST_EVENT_TIMESTAMP: simplisafe.initial_event_to_use[ system.system_id ].get("eventTimestamp"), @@ -736,3 +742,11 @@ class SimpliSafeBaseSensor(SimpliSafeEntity): self._device_info["model"] = sensor.type.name self._device_info["name"] = sensor.name self._sensor = sensor + self._sensor_type_human_name = " ".join( + [w.title() for w in self._sensor.type.name.split("_")] + ) + + @property + def name(self): + """Return the name of the sensor.""" + return f"{self._system.address} {self._name} {self._sensor_type_human_name}" diff --git a/homeassistant/components/simplisafe/binary_sensor.py b/homeassistant/components/simplisafe/binary_sensor.py index aa0132cb330..2a4f430e9cc 100644 --- a/homeassistant/components/simplisafe/binary_sensor.py +++ b/homeassistant/components/simplisafe/binary_sensor.py @@ -6,6 +6,8 @@ from homeassistant.components.binary_sensor import ( DEVICE_CLASS_DOOR, DEVICE_CLASS_GAS, DEVICE_CLASS_MOISTURE, + DEVICE_CLASS_MOTION, + DEVICE_CLASS_SAFETY, DEVICE_CLASS_SMOKE, BinarySensorEntity, ) @@ -18,7 +20,7 @@ SUPPORTED_BATTERY_SENSOR_TYPES = [ EntityTypes.carbon_monoxide, EntityTypes.entry, EntityTypes.leak, - EntityTypes.lock, + EntityTypes.lock_keypad, EntityTypes.smoke, EntityTypes.temperature, ] @@ -26,7 +28,9 @@ SUPPORTED_BATTERY_SENSOR_TYPES = [ TRIGGERED_SENSOR_TYPES = { EntityTypes.carbon_monoxide: DEVICE_CLASS_GAS, EntityTypes.entry: DEVICE_CLASS_DOOR, + EntityTypes.glass_break: DEVICE_CLASS_SAFETY, EntityTypes.leak: DEVICE_CLASS_MOISTURE, + EntityTypes.motion: DEVICE_CLASS_MOTION, EntityTypes.smoke: DEVICE_CLASS_SMOKE, } From b65c92ce912ef8c65b00c6d3eea9f8ea0570f70c Mon Sep 17 00:00:00 2001 From: cgtobi Date: Thu, 5 Nov 2020 14:16:51 +0100 Subject: [PATCH 5/8] Fix Netatmo public weather sensor bug (#42858) --- .../components/netatmo/netatmo_entity_base.py | 8 ++--- homeassistant/components/netatmo/sensor.py | 32 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/netatmo/netatmo_entity_base.py b/homeassistant/components/netatmo/netatmo_entity_base.py index 6bae7d54168..db2f8877f61 100644 --- a/homeassistant/components/netatmo/netatmo_entity_base.py +++ b/homeassistant/components/netatmo/netatmo_entity_base.py @@ -45,10 +45,10 @@ class NetatmoBase(Entity): data_class["name"], signal_name, self.async_update_callback, - LAT_NE=data_class["LAT_NE"], - LON_NE=data_class["LON_NE"], - LAT_SW=data_class["LAT_SW"], - LON_SW=data_class["LON_SW"], + lat_ne=data_class["lat_ne"], + lon_ne=data_class["lon_ne"], + lat_sw=data_class["lat_sw"], + lon_sw=data_class["lon_sw"], ) else: diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index 84e18ba7241..2e810ba2271 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -202,10 +202,10 @@ async def async_setup_entry(hass, entry, async_add_entities): PUBLICDATA_DATA_CLASS_NAME, signal_name, None, - LAT_NE=area.lat_ne, - LON_NE=area.lon_ne, - LAT_SW=area.lat_sw, - LON_SW=area.lon_sw, + lat_ne=area.lat_ne, + lon_ne=area.lon_ne, + lat_sw=area.lat_sw, + lon_sw=area.lon_sw, ) for sensor_type in SUPPORTED_PUBLIC_SENSOR_TYPES: new_entities.append( @@ -473,10 +473,10 @@ class NetatmoPublicSensor(NetatmoBase): self._data_classes.append( { "name": PUBLICDATA_DATA_CLASS_NAME, - "LAT_NE": area.lat_ne, - "LON_NE": area.lon_ne, - "LAT_SW": area.lat_sw, - "LON_SW": area.lon_sw, + "lat_ne": area.lat_ne, + "lon_ne": area.lon_ne, + "lat_sw": area.lat_sw, + "lon_sw": area.lon_sw, "area_name": area.area_name, SIGNAL_NAME: self._signal_name, } @@ -563,10 +563,10 @@ class NetatmoPublicSensor(NetatmoBase): self._data_classes = [ { "name": PUBLICDATA_DATA_CLASS_NAME, - "LAT_NE": area.lat_ne, - "LON_NE": area.lon_ne, - "LAT_SW": area.lat_sw, - "LON_SW": area.lon_sw, + "lat_ne": area.lat_ne, + "lon_ne": area.lon_ne, + "lat_sw": area.lat_sw, + "lon_sw": area.lon_sw, "area_name": area.area_name, SIGNAL_NAME: self._signal_name, } @@ -577,10 +577,10 @@ class NetatmoPublicSensor(NetatmoBase): PUBLICDATA_DATA_CLASS_NAME, self._signal_name, self.async_update_callback, - LAT_NE=area.lat_ne, - LON_NE=area.lon_ne, - LAT_SW=area.lat_sw, - LON_SW=area.lon_sw, + lat_ne=area.lat_ne, + lon_ne=area.lon_ne, + lat_sw=area.lat_sw, + lon_sw=area.lon_sw, ) @callback From 7d0f5fa31a8400332656b28a8fd7e00cd3becf6a Mon Sep 17 00:00:00 2001 From: Andreas Billmeier Date: Thu, 5 Nov 2020 09:45:29 +0100 Subject: [PATCH 6/8] Revert "Fix broken maxcube component" (#42859) This reverts commit 898f50386ff509ffb7b60a6e3f61eafc96ad484d. --- homeassistant/components/maxcube/binary_sensor.py | 2 +- homeassistant/components/maxcube/climate.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/maxcube/binary_sensor.py b/homeassistant/components/maxcube/binary_sensor.py index 376076352a6..06b53456973 100644 --- a/homeassistant/components/maxcube/binary_sensor.py +++ b/homeassistant/components/maxcube/binary_sensor.py @@ -16,7 +16,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): name = f"{cube.room_by_id(device.room_id).name} {device.name}" # Only add Window Shutters - if device.is_windowshutter(): + if cube.is_windowshutter(device): devices.append(MaxCubeShutter(handler, name, device.rf_address)) if devices: diff --git a/homeassistant/components/maxcube/climate.py b/homeassistant/components/maxcube/climate.py index c17cc988c1d..e222784ca57 100644 --- a/homeassistant/components/maxcube/climate.py +++ b/homeassistant/components/maxcube/climate.py @@ -70,7 +70,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): for device in cube.devices: name = f"{cube.room_by_id(device.room_id).name} {device.name}" - if device.is_thermostat() or device.is_wallthermostat(): + if cube.is_thermostat(device) or cube.is_wallthermostat(device): devices.append(MaxCubeClimate(handler, name, device.rf_address)) if devices: @@ -180,11 +180,11 @@ class MaxCubeClimate(ClimateEntity): device = cube.device_by_rf(self._rf_address) valve = 0 - if device.is_thermostat(): + if cube.is_thermostat(device): valve = device.valve_position - elif device.is_wallthermostat(): + elif cube.is_wallthermostat(device): for device in cube.devices_by_room(cube.room_by_id(device.room_id)): - if device.is_thermostat() and device.valve_position > 0: + if cube.is_thermostat(device) and device.valve_position > 0: valve = device.valve_position break else: @@ -287,7 +287,7 @@ class MaxCubeClimate(ClimateEntity): cube = self._cubehandle.cube device = cube.device_by_rf(self._rf_address) - if not device.is_thermostat(): + if not cube.is_thermostat(device): return {} return {ATTR_VALVE_POSITION: device.valve_position} From dfed834617736a4130a4a3c1da85e310cd62582e Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 5 Nov 2020 13:45:58 +0000 Subject: [PATCH 7/8] Bumped version to 0.117.5 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 8911ed2c5f2..7b660116296 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 117 -PATCH_VERSION = "4" +PATCH_VERSION = "5" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 1) From 8895c65dd497c3630dd193dc95c4ce0b4a45d960 Mon Sep 17 00:00:00 2001 From: rikroe <42204099+rikroe@users.noreply.github.com> Date: Thu, 5 Nov 2020 16:32:02 +0100 Subject: [PATCH 8/8] Bump bimmer_connected to 0.7.12 (#42875) Co-authored-by: rikroe --- homeassistant/components/bmw_connected_drive/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/bmw_connected_drive/manifest.json b/homeassistant/components/bmw_connected_drive/manifest.json index 6a886fc9ef4..85b521caa39 100644 --- a/homeassistant/components/bmw_connected_drive/manifest.json +++ b/homeassistant/components/bmw_connected_drive/manifest.json @@ -2,7 +2,7 @@ "domain": "bmw_connected_drive", "name": "BMW Connected Drive", "documentation": "https://www.home-assistant.io/integrations/bmw_connected_drive", - "requirements": ["bimmer_connected==0.7.11"], + "requirements": ["bimmer_connected==0.7.12"], "dependencies": [], "codeowners": ["@gerard33", "@rikroe"] } diff --git a/requirements_all.txt b/requirements_all.txt index 7504b10e9e2..c490cb121ea 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -342,7 +342,7 @@ beautifulsoup4==4.9.1 bellows==0.20.3 # homeassistant.components.bmw_connected_drive -bimmer_connected==0.7.11 +bimmer_connected==0.7.12 # homeassistant.components.bizkaibus bizkaibus==0.1.1