From 3b1938d5ec4d153976274c97ebd741924c0df7f8 Mon Sep 17 00:00:00 2001 From: Lukas Kempf Date: Wed, 13 Oct 2021 15:33:37 +0200 Subject: [PATCH] Add unique_id support for eq3btsmart (#57603) --- homeassistant/components/eq3btsmart/climate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/eq3btsmart/climate.py b/homeassistant/components/eq3btsmart/climate.py index f803c9c0bd5..3c3d41d090c 100644 --- a/homeassistant/components/eq3btsmart/climate.py +++ b/homeassistant/components/eq3btsmart/climate.py @@ -24,6 +24,7 @@ from homeassistant.const import ( TEMP_CELSIUS, ) import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.device_registry import format_mac _LOGGER = logging.getLogger(__name__) @@ -82,6 +83,7 @@ class EQ3BTSmartThermostat(ClimateEntity): """Initialize the thermostat.""" # We want to avoid name clash with this module. self._name = _name + self._mac = _mac self._thermostat = eq3.Thermostat(_mac) @property @@ -183,6 +185,11 @@ class EQ3BTSmartThermostat(ClimateEntity): """ return list(HA_TO_EQ_PRESET) + @property + def unique_id(self) -> str: + """Return the MAC address of the thermostat.""" + return format_mac(self._mac) + def set_preset_mode(self, preset_mode): """Set new preset mode.""" if preset_mode == PRESET_NONE: