Google assistant openclose (#39612)
* Make sure we set discreteOnlyOpenClose for binary sensors * Mark switches that are assumed state as commandOnlyOnOff * Drop stray extra line * Fix pylint error Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
This commit is contained in:
1 parent
8818a5ab6c
commit
d128443a2a
3 files changed
+20
-3
No files matched your search
@@ -315,6 +315,8 @@ class OnOffTrait(_Trait):
|
||||
|
||||
def sync_attributes(self):
|
||||
"""Return OnOff attributes for a sync request."""
|
||||
if self.state.attributes.get(ATTR_ASSUMED_STATE, False):
|
||||
return {"commandOnlyOnOff": True}
|
||||
return {}
|
||||
|
||||
def query_attributes(self):
|
||||
@@ -1541,6 +1543,7 @@ class OpenCloseTrait(_Trait):
|
||||
response = {}
|
||||
if self.state.domain == binary_sensor.DOMAIN:
|
||||
response["queryOnlyOpenClose"] = True
|
||||
response["discreteOnlyOpenClose"] = True
|
||||
return response
|
||||
|
||||
def query_attributes(self):
|
||||
|
||||
Reference in new issue
Block a user