mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add unique_id for Daikin entities (#18747)
This commit is contained in:
parent
eb2e2a116e
commit
5d5c78b374
@ -192,6 +192,11 @@ class DaikinClimate(ClimateDevice):
|
|||||||
"""Return the name of the thermostat, if any."""
|
"""Return the name of the thermostat, if any."""
|
||||||
return self._api.name
|
return self._api.name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._api.mac
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self):
|
def temperature_unit(self):
|
||||||
"""Return the unit of measurement which this thermostat uses."""
|
"""Return the unit of measurement which this thermostat uses."""
|
||||||
|
@ -132,3 +132,8 @@ class DaikinApi:
|
|||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Connection failed for %s", self.ip_address
|
"Connection failed for %s", self.ip_address
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mac(self):
|
||||||
|
"""Return mac-address of device."""
|
||||||
|
return self.device.values.get('mac')
|
||||||
|
@ -71,6 +71,11 @@ class DaikinClimateSensor(Entity):
|
|||||||
if self._sensor[CONF_TYPE] == SENSOR_TYPE_TEMPERATURE:
|
if self._sensor[CONF_TYPE] == SENSOR_TYPE_TEMPERATURE:
|
||||||
self._unit_of_measurement = units.temperature_unit
|
self._unit_of_measurement = units.temperature_unit
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return "{}-{}".format(self._api.mac, self._device_attribute)
|
||||||
|
|
||||||
def get(self, key):
|
def get(self, key):
|
||||||
"""Retrieve device settings from API library cache."""
|
"""Retrieve device settings from API library cache."""
|
||||||
value = None
|
value = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user