diff --git a/custom_components/myskoda/entity.py b/custom_components/myskoda/entity.py index 8b35a75..3cf31ff 100644 --- a/custom_components/myskoda/entity.py +++ b/custom_components/myskoda/entity.py @@ -46,11 +46,19 @@ def device_info(self) -> DeviceInfo: # noqa: D102 def required_capabilities(self) -> list[CapabilityId]: return [] + def forbidden_capabilities(self) -> list[CapabilityId]: + return [] + def is_supported(self) -> bool: return all( self.vehicle.has_capability(cap) for cap in self.required_capabilities() ) + def is_forbidden(self) -> bool: + return all( + self.vehicle.has_capability(cap) for cap in self.forbidden_capabilities() + ) + def get_renders(self) -> dict[str, str]: """Return a dict of all vehicle image render URLs, keyed by view_point. diff --git a/custom_components/myskoda/utils.py b/custom_components/myskoda/utils.py index 269769b..f498ce5 100644 --- a/custom_components/myskoda/utils.py +++ b/custom_components/myskoda/utils.py @@ -18,7 +18,8 @@ def add_supported_entities( for vin in coordinators: for SensorClass in available_entities: sensor = SensorClass(coordinators[vin], vin) - if sensor.is_supported(): - entities.append(sensor) + if not sensor.is_forbidden(): + if sensor.is_supported(): + entities.append(sensor) async_add_entities(entities, update_before_add=True)