Address review comment from #55833 (#55985)

This commit is contained in:
Erik Montnemery
2021-09-08 22:48:31 +02:00
committed by GitHub
parent 4d2432cffb
commit a1aca20818

View File

@@ -2314,10 +2314,7 @@ class SensorStateTrait(_Trait):
@classmethod @classmethod
def supported(cls, domain, features, device_class, _): def supported(cls, domain, features, device_class, _):
"""Test if state is supported.""" """Test if state is supported."""
return ( return domain == sensor.DOMAIN and device_class in cls.sensor_types
domain == sensor.DOMAIN
and device_class in SensorStateTrait.sensor_types.keys()
)
def sync_attributes(self): def sync_attributes(self):
"""Return attributes for a sync request.""" """Return attributes for a sync request."""