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>
This commit is contained in:
parent
29da43b9a9
commit
73cfe659ea
5 changed files with 29 additions and 6 deletions
|
@ -23,14 +23,13 @@ from .entity import HydrawiseEntity
|
||||||
|
|
||||||
BINARY_SENSOR_STATUS = BinarySensorEntityDescription(
|
BINARY_SENSOR_STATUS = BinarySensorEntityDescription(
|
||||||
key="status",
|
key="status",
|
||||||
name="Status",
|
|
||||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||||
)
|
)
|
||||||
|
|
||||||
BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
||||||
BinarySensorEntityDescription(
|
BinarySensorEntityDescription(
|
||||||
key="is_watering",
|
key="is_watering",
|
||||||
name="Watering",
|
translation_key="watering",
|
||||||
device_class=BinarySensorDeviceClass.MOISTURE,
|
device_class=BinarySensorDeviceClass.MOISTURE,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,7 @@ class HydrawiseEntity(CoordinatorEntity[HydrawiseDataUpdateCoordinator]):
|
||||||
"""Entity class for Hydrawise devices."""
|
"""Entity class for Hydrawise devices."""
|
||||||
|
|
||||||
_attr_attribution = "Data provided by hydrawise.com"
|
_attr_attribution = "Data provided by hydrawise.com"
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -24,12 +24,12 @@ from .entity import HydrawiseEntity
|
||||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="next_cycle",
|
key="next_cycle",
|
||||||
name="Next Cycle",
|
translation_key="next_cycle",
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="watering_time",
|
key="watering_time",
|
||||||
name="Watering Time",
|
translation_key="watering_time",
|
||||||
icon="mdi:water-pump",
|
icon="mdi:water-pump",
|
||||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||||
),
|
),
|
||||||
|
|
|
@ -21,5 +21,28 @@
|
||||||
"title": "The Hydrawise YAML configuration import failed",
|
"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."
|
"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, ...] = (
|
SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
||||||
SwitchEntityDescription(
|
SwitchEntityDescription(
|
||||||
key="auto_watering",
|
key="auto_watering",
|
||||||
name="Automatic Watering",
|
translation_key="auto_watering",
|
||||||
device_class=SwitchDeviceClass.SWITCH,
|
device_class=SwitchDeviceClass.SWITCH,
|
||||||
),
|
),
|
||||||
SwitchEntityDescription(
|
SwitchEntityDescription(
|
||||||
key="manual_watering",
|
key="manual_watering",
|
||||||
name="Manual Watering",
|
translation_key="manual_watering",
|
||||||
device_class=SwitchDeviceClass.SWITCH,
|
device_class=SwitchDeviceClass.SWITCH,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue