Add unique_id for Neato (#17369)
* Add unique_id for Neato * Only send the serial per review comments
This commit is contained in:
parent
3cf6c76f8b
commit
d3672f36fb
3 changed files with 17 additions and 0 deletions
|
@ -63,3 +63,8 @@ class NeatoCleaningMap(Camera):
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of this camera."""
|
"""Return the name of this camera."""
|
||||||
return self._robot_name
|
return self._robot_name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return unique ID."""
|
||||||
|
return self._robot_serial
|
||||||
|
|
|
@ -52,6 +52,7 @@ class NeatoConnectedSwitch(ToggleEntity):
|
||||||
self._state = None
|
self._state = None
|
||||||
self._schedule_state = None
|
self._schedule_state = None
|
||||||
self._clean_state = None
|
self._clean_state = None
|
||||||
|
self._robot_serial = self.robot.serial
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the states of Neato switches."""
|
"""Update the states of Neato switches."""
|
||||||
|
@ -83,6 +84,11 @@ class NeatoConnectedSwitch(ToggleEntity):
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._robot_serial
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if switch is on."""
|
"""Return true if switch is on."""
|
||||||
|
|
|
@ -66,6 +66,7 @@ class NeatoConnectedVacuum(StateVacuumDevice):
|
||||||
self.clean_suspension_time = None
|
self.clean_suspension_time = None
|
||||||
self._available = False
|
self._available = False
|
||||||
self._battery_level = None
|
self._battery_level = None
|
||||||
|
self._robot_serial = self.robot.serial
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the states of Neato Vacuums."""
|
"""Update the states of Neato Vacuums."""
|
||||||
|
@ -156,6 +157,11 @@ class NeatoConnectedVacuum(StateVacuumDevice):
|
||||||
"""Return the status of the vacuum cleaner."""
|
"""Return the status of the vacuum cleaner."""
|
||||||
return self._clean_state
|
return self._clean_state
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return a unique ID."""
|
||||||
|
return self._robot_serial
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes of the vacuum cleaner."""
|
"""Return the state attributes of the vacuum cleaner."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue