1
0
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:
Paulus Schoutsen
2018-03-20 18:09:34 -07:00
committed by GitHub
parent 852eef8046
commit cfb0b00c0c
3 changed files with 38 additions and 2 deletions

View File

@@ -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