mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Add unique_id support for eq3btsmart (#57603)
This commit is contained in:
parent
c470a03a4e
commit
3b1938d5ec
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user