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
14 changes: 7 additions & 7 deletions homeassistant/components/rainmachine/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,46 +44,46 @@ class RainMachineBinarySensorDescription(
BINARY_SENSOR_DESCRIPTIONS = (
RainMachineBinarySensorDescription(
key=TYPE_FLOW_SENSOR,
name="Flow sensor",
translation_key=TYPE_FLOW_SENSOR,
icon="mdi:water-pump",
api_category=DATA_PROVISION_SETTINGS,
data_key="useFlowSensor",
),
RainMachineBinarySensorDescription(
key=TYPE_FREEZE,
name="Freeze restrictions",
translation_key=TYPE_FREEZE,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
api_category=DATA_RESTRICTIONS_CURRENT,
data_key="freeze",
),
RainMachineBinarySensorDescription(
key=TYPE_HOURLY,
name="Hourly restrictions",
translation_key=TYPE_HOURLY,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
api_category=DATA_RESTRICTIONS_CURRENT,
data_key="hourly",
),
RainMachineBinarySensorDescription(
key=TYPE_MONTH,
name="Month restrictions",
translation_key=TYPE_MONTH,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
api_category=DATA_RESTRICTIONS_CURRENT,
data_key="month",
),
RainMachineBinarySensorDescription(
key=TYPE_RAINDELAY,
name="Rain delay restrictions",
translation_key=TYPE_RAINDELAY,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
api_category=DATA_RESTRICTIONS_CURRENT,
data_key="rainDelay",
),
RainMachineBinarySensorDescription(
key=TYPE_RAINSENSOR,
name="Rain sensor restrictions",
translation_key=TYPE_RAINSENSOR,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
Expand All @@ -92,7 +92,7 @@ class RainMachineBinarySensorDescription(
),
RainMachineBinarySensorDescription(
key=TYPE_WEEKDAY,
name="Weekday restrictions",
translation_key=TYPE_WEEKDAY,
icon="mdi:cancel",
entity_category=EntityCategory.DIAGNOSTIC,
api_category=DATA_RESTRICTIONS_CURRENT,
Expand Down
1 change: 0 additions & 1 deletion homeassistant/components/rainmachine/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ async def _async_reboot(controller: Controller) -> None:
BUTTON_DESCRIPTIONS = (
RainMachineButtonDescription(
key=BUTTON_KIND_REBOOT,
name="Reboot",
api_category=DATA_PROVISION_SETTINGS,
push_action=_async_reboot,
),
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/rainmachine/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class FreezeProtectionSelectDescription(
SELECT_DESCRIPTIONS = (
FreezeProtectionSelectDescription(
key=TYPE_FREEZE_PROTECTION_TEMPERATURE,
name="Freeze protection temperature",
translation_key=TYPE_FREEZE_PROTECTION_TEMPERATURE,
icon="mdi:thermometer",
entity_category=EntityCategory.CONFIG,
api_category=DATA_RESTRICTIONS_UNIVERSAL,
Expand Down
16 changes: 8 additions & 8 deletions homeassistant/components/rainmachine/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class RainMachineSensorCompletionTimerDescription(
SENSOR_DESCRIPTIONS = (
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_CLICK_M3,
name="Flow sensor clicks per cubic meter",
translation_key=TYPE_FLOW_SENSOR_CLICK_M3,
icon="mdi:water-pump",
native_unit_of_measurement=f"clicks/{UnitOfVolume.CUBIC_METERS}",
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -80,7 +80,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_CONSUMED_LITERS,
name="Flow sensor consumed liters",
translation_key=TYPE_FLOW_SENSOR_CONSUMED_LITERS,
icon="mdi:water-pump",
device_class=SensorDeviceClass.WATER,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -92,7 +92,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_LEAK_CLICKS,
name="Flow sensor leak clicks",
translation_key=TYPE_FLOW_SENSOR_LEAK_CLICKS,
icon="mdi:pipe-leak",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement="clicks",
Expand All @@ -103,7 +103,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_LEAK_VOLUME,
name="Flow sensor leak volume",
translation_key=TYPE_FLOW_SENSOR_LEAK_VOLUME,
icon="mdi:pipe-leak",
device_class=SensorDeviceClass.WATER,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -115,7 +115,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_START_INDEX,
name="Flow sensor start index",
translation_key=TYPE_FLOW_SENSOR_START_INDEX,
icon="mdi:water-pump",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement="index",
Expand All @@ -125,7 +125,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_FLOW_SENSOR_WATERING_CLICKS,
name="Flow sensor clicks",
translation_key=TYPE_FLOW_SENSOR_WATERING_CLICKS,
icon="mdi:water-pump",
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement="clicks",
Expand All @@ -136,7 +136,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_LAST_LEAK_DETECTED,
name="Last leak detected",
translation_key=TYPE_LAST_LEAK_DETECTED,
icon="mdi:pipe-leak",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
Expand All @@ -147,7 +147,7 @@ class RainMachineSensorCompletionTimerDescription(
),
RainMachineSensorDataDescription(
key=TYPE_RAIN_SENSOR_RAIN_START,
name="Rain sensor rain start",
translation_key=TYPE_RAIN_SENSOR_RAIN_START,
icon="mdi:weather-pouring",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
Expand Down
69 changes: 69 additions & 0 deletions homeassistant/components/rainmachine/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,74 @@
}
}
}
},
"entity": {
"binary_sensor": {
"flow_sensor": {
"name": "Flow sensor"
},
"freeze": {
"name": "Freeze restrictions"
},
"hourly": {
"name": "Hourly restrictions"
},
"month": {
"name": "Month restrictions"
},
"raindelay": {
"name": "Rain delay restrictions"
},
"rainsensor": {
"name": "Rain sensor restrictions"
},
"weekday": {
"name": "Weekday restrictions"
}
},
"select": {
"freeze_protection_temperature": {
"name": "Freeze protection temperature"
}
},
"sensor": {
"flow_sensor_clicks_cubic_meter": {
"name": "Flow sensor clicks per cubic meter"
},
"flow_sensor_consumed_liters": {
"name": "Flow sensor consumed liters"
},
"flow_sensor_leak_clicks": {
"name": "Flow sensor leak clicks"
},
"flow_sensor_leak_volume": {
"name": "Flow sensor leak volume"
},
"flow_sensor_start_index": {
"name": "Flow sensor start index"
},
"flow_sensor_watering_clicks": {
"name": "Flow sensor clicks"
},
"last_leak_detected": {
"name": "Last leak detected"
},
"rain_sensor_rain_start": {
"name": "Rain sensor rain start"
}
},
"switch": {
"freeze_protect_enabled": {
"name": "Freeze protection"
},
"hot_days_extra_watering": {
"name": "Extra water on hot days"
}
},
"update": {
"firmware": {
"name": "Firmware"
}
}
}
}
4 changes: 2 additions & 2 deletions homeassistant/components/rainmachine/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ class RainMachineRestrictionSwitchDescription(
RESTRICTIONS_SWITCH_DESCRIPTIONS = (
RainMachineRestrictionSwitchDescription(
key=TYPE_RESTRICTIONS_FREEZE_PROTECT_ENABLED,
name="Freeze protection",
translation_key=TYPE_RESTRICTIONS_FREEZE_PROTECT_ENABLED,
icon="mdi:snowflake-alert",
api_category=DATA_RESTRICTIONS_UNIVERSAL,
data_key="freezeProtectEnabled",
),
RainMachineRestrictionSwitchDescription(
key=TYPE_RESTRICTIONS_HOT_DAYS_EXTRA_WATERING,
name="Extra water on hot days",
translation_key=TYPE_RESTRICTIONS_HOT_DAYS_EXTRA_WATERING,
icon="mdi:heat-wave",
api_category=DATA_RESTRICTIONS_UNIVERSAL,
data_key="hotDaysExtraWatering",
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/rainmachine/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class UpdateStates(Enum):

UPDATE_DESCRIPTION = RainMachineEntityDescription(
key="update",
name="Firmware",
Comment thread
joostlek marked this conversation as resolved.
translation_key="firmware",
api_category=DATA_MACHINE_FIRMWARE_UPDATE_STATUS,
)


async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up WLED update based on a config entry."""
"""Set up Rainmachine update based on a config entry."""
data: RainMachineData = hass.data[DOMAIN][entry.entry_id]

async_add_entities([RainMachineUpdateEntity(entry, data, UPDATE_DESCRIPTION)])
Expand Down