Fix Alexa ChangeReports Filter non-proactively_reported_properties (#30655)

* Fix Change Report Properties.

* Fix Change Report Properties.
pull/30662/head
ochlocracy 2020-01-10 16:34:50 -05:00 committed by Paulus Schoutsen
parent 3f29c234b8
commit d0062fc740
2 changed files with 15 additions and 0 deletions

View File

@ -503,6 +503,10 @@ class AlexaColorController(AlexaCapability):
"""Return what properties this entity supports.""" """Return what properties this entity supports."""
return [{"name": "color"}] return [{"name": "color"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self): def properties_retrievable(self):
"""Return True if properties can be retrieved.""" """Return True if properties can be retrieved."""
return True return True
@ -548,6 +552,10 @@ class AlexaColorTemperatureController(AlexaCapability):
"""Return what properties this entity supports.""" """Return what properties this entity supports."""
return [{"name": "colorTemperatureInKelvin"}] return [{"name": "colorTemperatureInKelvin"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self): def properties_retrievable(self):
"""Return True if properties can be retrieved.""" """Return True if properties can be retrieved."""
return True return True
@ -590,6 +598,10 @@ class AlexaPercentageController(AlexaCapability):
"""Return what properties this entity supports.""" """Return what properties this entity supports."""
return [{"name": "percentage"}] return [{"name": "percentage"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self): def properties_retrievable(self):
"""Return True if properties can be retrieved.""" """Return True if properties can be retrieved."""
return True return True

View File

@ -255,6 +255,9 @@ class AlexaEntity:
def serialize_properties(self): def serialize_properties(self):
"""Yield each supported property in API format.""" """Yield each supported property in API format."""
for interface in self.interfaces(): for interface in self.interfaces():
if not interface.properties_proactively_reported():
continue
for prop in interface.serialize_properties(): for prop in interface.serialize_properties():
yield prop yield prop