mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Enable Google Assistant OnOffTrait for climate devices that support them (#18544)
* Enable Google Assistant OnOffTrait for climate devices that support them This commit enables the OnOffTrait for climate devices that have the SUPPORT_ON_OFF feature. I have tested this locally with a Sensibo device which supports ON_OFF and a nest device that does not. * Update trait.py * Add tests for onoff_climate * Add OnOff trait to climate.heatpump * Add on status to heatpump in google_assistant tests
This commit is contained in:
committed by
Paulus Schoutsen
parent
2f07e92cc2
commit
02309cc318
@@ -197,6 +197,8 @@ class OnOffTrait(_Trait):
|
||||
@staticmethod
|
||||
def supported(domain, features):
|
||||
"""Test if state is supported."""
|
||||
if domain == climate.DOMAIN:
|
||||
return features & climate.SUPPORT_ON_OFF != 0
|
||||
return domain in (
|
||||
group.DOMAIN,
|
||||
input_boolean.DOMAIN,
|
||||
|
||||
Reference in New Issue
Block a user