1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-27 14:31:13 +00:00

Add device class filter to hydrawise services (#153249)

This commit is contained in:
Erik Montnemery
2025-10-05 23:14:12 +02:00
committed by GitHub
parent a04835629b
commit 7f931e4d70

View File

@@ -122,11 +122,24 @@ async def async_setup_entry(
coordinators.main.new_zones_callbacks.append(_add_new_zones)
platform = entity_platform.async_get_current_platform()
platform.async_register_entity_service(SERVICE_RESUME, None, "resume")
platform.async_register_entity_service(
SERVICE_START_WATERING, SCHEMA_START_WATERING, "start_watering"
SERVICE_RESUME,
None,
"resume",
entity_device_classes=(BinarySensorDeviceClass.RUNNING,),
)
platform.async_register_entity_service(
SERVICE_START_WATERING,
SCHEMA_START_WATERING,
"start_watering",
entity_device_classes=(BinarySensorDeviceClass.RUNNING,),
)
platform.async_register_entity_service(
SERVICE_SUSPEND,
SCHEMA_SUSPEND,
"suspend",
entity_device_classes=(BinarySensorDeviceClass.RUNNING,),
)
platform.async_register_entity_service(SERVICE_SUSPEND, SCHEMA_SUSPEND, "suspend")
class HydrawiseBinarySensor(HydrawiseEntity, BinarySensorEntity):