deCONZ - battery sensor instead of battery attribute (#26591)

* Allow all sensors to create battery sensors
* Neither binary sensor, climate nor sensor will have battery attributes
This commit is contained in:
Robert Svensson 2019-09-14 19:15:18 +02:00 committed by GitHub
parent 24f1ff0aef
commit 41c9ed5d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 48 deletions

View file

@ -24,10 +24,10 @@ class DeconzBase:
@property
def serial(self):
"""Return a serial number for this device."""
if self.unique_id is None or self.unique_id.count(":") != 7:
if self._device.uniqueid is None or self._device.uniqueid.count(":") != 7:
return None
return self.unique_id.split("-", 1)[0]
return self._device.uniqueid.split("-", 1)[0]
@property
def device_info(self):