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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user