Make Hydrawise compliant with new naming standards (#100921)
* Make Hydrawise compliant with new naming standards * Update binary_sensor.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>pull/100927/head
parent
29da43b9a9
commit
73cfe659ea
|
@ -23,14 +23,13 @@ from .entity import HydrawiseEntity
|
|||
|
||||
BINARY_SENSOR_STATUS = BinarySensorEntityDescription(
|
||||
key="status",
|
||||
name="Status",
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
)
|
||||
|
||||
BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
||||
BinarySensorEntityDescription(
|
||||
key="is_watering",
|
||||
name="Watering",
|
||||
translation_key="watering",
|
||||
device_class=BinarySensorDeviceClass.MOISTURE,
|
||||
),
|
||||
)
|
||||
|
|
|
@ -15,6 +15,7 @@ class HydrawiseEntity(CoordinatorEntity[HydrawiseDataUpdateCoordinator]):
|
|||
"""Entity class for Hydrawise devices."""
|
||||
|
||||
_attr_attribution = "Data provided by hydrawise.com"
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -24,12 +24,12 @@ from .entity import HydrawiseEntity
|
|||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="next_cycle",
|
||||
name="Next Cycle",
|
||||
translation_key="next_cycle",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="watering_time",
|
||||
name="Watering Time",
|
||||
translation_key="watering_time",
|
||||
icon="mdi:water-pump",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
),
|
||||
|
|
|
@ -21,5 +21,28 @@
|
|||
"title": "The Hydrawise YAML configuration import failed",
|
||||
"description": "Configuring Hydrawise using YAML is being removed but there was an {error_type} error importing your YAML configuration.\n\nEnsure connection to Hydrawise works and restart Home Assistant to try again or remove the Hydrawise YAML configuration from your configuration.yaml file and continue to [set up the integration]({url}) manually."
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"watering": {
|
||||
"name": "Watering"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"next_cycle": {
|
||||
"name": "Next cycle"
|
||||
},
|
||||
"watering_time": {
|
||||
"name": "Watering time"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"auto_watering": {
|
||||
"name": "Automatic watering"
|
||||
},
|
||||
"manual_watering": {
|
||||
"name": "Manual watering"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ from .entity import HydrawiseEntity
|
|||
SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
||||
SwitchEntityDescription(
|
||||
key="auto_watering",
|
||||
name="Automatic Watering",
|
||||
translation_key="auto_watering",
|
||||
device_class=SwitchDeviceClass.SWITCH,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key="manual_watering",
|
||||
name="Manual Watering",
|
||||
translation_key="manual_watering",
|
||||
device_class=SwitchDeviceClass.SWITCH,
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue