mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Do not include unavailable entities in Google Assistant SYNC (#13358)
This commit is contained in:
@@ -94,9 +94,16 @@ class _GoogleEntity:
|
||||
|
||||
https://developers.google.com/actions/smarthome/create-app#actiondevicessync
|
||||
"""
|
||||
traits = self.traits()
|
||||
state = self.state
|
||||
|
||||
# When a state is unavailable, the attributes that describe
|
||||
# capabilities will be stripped. For example, a light entity will miss
|
||||
# the min/max mireds. Therefore they will be excluded from a sync.
|
||||
if state.state == STATE_UNAVAILABLE:
|
||||
return None
|
||||
|
||||
traits = self.traits()
|
||||
|
||||
# Found no supported traits for this entity
|
||||
if not traits:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user