Use entity property available
This commit is contained in:
parent
058315720f
commit
75775a561b
2 changed files with 10 additions and 0 deletions
|
@ -180,6 +180,11 @@ class MySensorsSensor(Entity):
|
|||
self.gateway.version)
|
||||
return attr
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
"""Return True if entity is available."""
|
||||
return self.value_type in self._values
|
||||
|
||||
def update(self):
|
||||
"""Update the controller with the latest values from a sensor."""
|
||||
node = self.gateway.sensors[self.node_id]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue