1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00

Add unique_id for Neato (#17369)

* Add unique_id for Neato

* Only send the serial per review comments
This commit is contained in:
Daniel Shokouhi 2018-10-12 15:33:13 -07:00 committed by Fabian Affolter
parent 3cf6c76f8b
commit d3672f36fb
3 changed files with 17 additions and 0 deletions

View File

@ -63,3 +63,8 @@ class NeatoCleaningMap(Camera):
def name(self):
"""Return the name of this camera."""
return self._robot_name
@property
def unique_id(self):
"""Return unique ID."""
return self._robot_serial

View File

@ -52,6 +52,7 @@ class NeatoConnectedSwitch(ToggleEntity):
self._state = None
self._schedule_state = None
self._clean_state = None
self._robot_serial = self.robot.serial
def update(self):
"""Update the states of Neato switches."""
@ -83,6 +84,11 @@ class NeatoConnectedSwitch(ToggleEntity):
"""Return True if entity is available."""
return self._state
@property
def unique_id(self):
"""Return a unique ID."""
return self._robot_serial
@property
def is_on(self):
"""Return true if switch is on."""

View File

@ -66,6 +66,7 @@ class NeatoConnectedVacuum(StateVacuumDevice):
self.clean_suspension_time = None
self._available = False
self._battery_level = None
self._robot_serial = self.robot.serial
def update(self):
"""Update the states of Neato Vacuums."""
@ -156,6 +157,11 @@ class NeatoConnectedVacuum(StateVacuumDevice):
"""Return the status of the vacuum cleaner."""
return self._clean_state
@property
def unique_id(self):
"""Return a unique ID."""
return self._robot_serial
@property
def device_state_attributes(self):
"""Return the state attributes of the vacuum cleaner."""