Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions homeassistant/components/melnor/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MelnorZoneNumberEntityDescription(
native_min_value=1,
icon="mdi:timer-cog-outline",
key="manual_minutes",
name="Manual Duration",
translation_key="manual_minutes",
native_unit_of_measurement=UnitOfTime.MINUTES,
set_num_fn=lambda valve, value: valve.set_manual_watering_minutes(value),
state_fn=lambda valve: valve.manual_watering_minutes,
Expand All @@ -59,7 +59,7 @@ class MelnorZoneNumberEntityDescription(
native_min_value=1,
icon="mdi:calendar-refresh-outline",
key="frequency_interval_hours",
name="Schedule Interval",
translation_key="frequency_interval_hours",
native_unit_of_measurement=UnitOfTime.HOURS,
set_num_fn=lambda valve, value: valve.set_frequency_interval_hours(value),
state_fn=lambda valve: valve.frequency.interval_hours,
Expand All @@ -70,7 +70,7 @@ class MelnorZoneNumberEntityDescription(
native_min_value=1,
icon="mdi:timer-outline",
key="frequency_duration_minutes",
name="Schedule Duration",
translation_key="frequency_duration_minutes",
native_unit_of_measurement=UnitOfTime.MINUTES,
set_num_fn=lambda valve, value: valve.set_frequency_duration_minutes(value),
state_fn=lambda valve: valve.frequency.duration_minutes,
Expand Down
7 changes: 3 additions & 4 deletions homeassistant/components/melnor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class MelnorSensorEntityDescription(
device_class=SensorDeviceClass.BATTERY,
entity_category=EntityCategory.DIAGNOSTIC,
key="battery",
name="Battery",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
state_fn=lambda device: device.battery_level,
Expand All @@ -97,7 +96,7 @@ class MelnorSensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key="rssi",
name="RSSI",
translation_key="rssi",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
state_class=SensorStateClass.MEASUREMENT,
state_fn=lambda device: device.rssi,
Expand All @@ -108,13 +107,13 @@ class MelnorSensorEntityDescription(
MelnorZoneSensorEntityDescription(
device_class=SensorDeviceClass.TIMESTAMP,
key="manual_cycle_end",
name="Manual Cycle End",
translation_key="manual_cycle_end",
state_fn=watering_seconds_left,
),
MelnorZoneSensorEntityDescription(
device_class=SensorDeviceClass.TIMESTAMP,
key="next_cycle",
name="Next Cycle",
translation_key="next_cycle",
state_fn=next_cycle,
),
]
Expand Down
34 changes: 34 additions & 0 deletions homeassistant/components/melnor/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,39 @@
"title": "Discovered Melnor Bluetooth valve"
}
}
},
"entity": {
"number": {
"manual_minutes": {
"name": "Manual duration"
},
"frequency_interval_hours": {
"name": "Schedule interval"
},
"frequency_duration_minutes": {
"name": "Schedule duration"
}
},
"sensor": {
"rssi": {
"name": "RSSI"
},
"manual_cycle_end": {
"name": "Manual cycle end"
},
"next_cycle": {
"name": "Next cycle"
}
},
"switch": {
"frequency": {
"name": "Schedule"
}
},
"time": {
"frequency_start_time": {
"name": "Schedule start time"
}
}
}
}
2 changes: 1 addition & 1 deletion homeassistant/components/melnor/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MelnorSwitchEntityDescription(
device_class=SwitchDeviceClass.SWITCH,
icon="mdi:calendar-sync-outline",
key="frequency",
name="Schedule",
translation_key="frequency",
on_off_fn=lambda valve, bool: valve.set_frequency_enabled(bool),
state_fn=lambda valve: valve.schedule_enabled,
),
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/melnor/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MelnorZoneTimeEntityDescription(
MelnorZoneTimeEntityDescription(
entity_category=EntityCategory.CONFIG,
key="frequency_start_time",
name="Schedule Start Time",
translation_key="frequency_start_time",
set_time_fn=lambda valve, value: valve.set_frequency_start_time(value),
state_fn=lambda valve: valve.frequency.start_time,
),
Expand Down