Provide unique id for enocean devices (#71774)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
7d2deae592
commit
c67bbd06d4
4 changed files with 37 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
"""Support for EnOcean binary sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from enocean.utils import combine_hex
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
|
@ -57,6 +58,7 @@ class EnOceanBinarySensor(EnOceanEntity, BinarySensorEntity):
|
|||
self._device_class = device_class
|
||||
self.which = -1
|
||||
self.onoff = -1
|
||||
self._attr_unique_id = f"{combine_hex(dev_id)}-{device_class}"
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue