Axis devices support device registry (#22367)
* Add support for device registry * Fix test
This commit is contained in:
parent
646c4a7137
commit
52437f6246
5 changed files with 44 additions and 1 deletions
|
@ -81,7 +81,20 @@ class AxisBinarySensor(BinarySensorDevice):
|
|||
"""Return the class of the event."""
|
||||
return self.event.event_class
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return a unique identifier for this device."""
|
||||
return '{}-{}-{}'.format(
|
||||
self.device.serial, self.event.topic, self.event.id)
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
"""Return a device description for device registry."""
|
||||
return {
|
||||
'identifiers': {(AXIS_DOMAIN, self.device.serial)}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue