Add configuration URL to RainMachine (#57732)
parent
34fee4ba60
commit
f13eeee969
|
@ -323,6 +323,7 @@ class RainMachineEntity(CoordinatorEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
entry: ConfigEntry,
|
||||
coordinator: DataUpdateCoordinator,
|
||||
controller: Controller,
|
||||
description: EntityDescription,
|
||||
|
@ -332,6 +333,7 @@ class RainMachineEntity(CoordinatorEntity):
|
|||
|
||||
self._attr_device_info = {
|
||||
"identifiers": {(DOMAIN, controller.mac)},
|
||||
"configuration_url": f"https://{entry.data[CONF_IP_ADDRESS]}:{entry.data[CONF_PORT]}",
|
||||
"connections": {(dr.CONNECTION_NETWORK_MAC, controller.mac)},
|
||||
"name": str(controller.name),
|
||||
"manufacturer": "RainMachine",
|
||||
|
|
|
@ -131,7 +131,7 @@ async def async_setup_entry(
|
|||
|
||||
async_add_entities(
|
||||
[
|
||||
async_get_sensor(description.api_category)(controller, description)
|
||||
async_get_sensor(description.api_category)(entry, controller, description)
|
||||
for description in BINARY_SENSOR_DESCRIPTIONS
|
||||
]
|
||||
)
|
||||
|
|
|
@ -114,7 +114,7 @@ async def async_setup_entry(
|
|||
|
||||
async_add_entities(
|
||||
[
|
||||
async_get_sensor(description.api_category)(controller, description)
|
||||
async_get_sensor(description.api_category)(entry, controller, description)
|
||||
for description in SENSOR_DESCRIPTIONS
|
||||
]
|
||||
)
|
||||
|
|
|
@ -157,9 +157,9 @@ async def async_setup_entry(
|
|||
|
||||
entities: list[RainMachineProgram | RainMachineZone] = [
|
||||
RainMachineProgram(
|
||||
entry,
|
||||
programs_coordinator,
|
||||
controller,
|
||||
entry,
|
||||
RainMachineSwitchDescription(
|
||||
key=f"RainMachineProgram_{uid}", name=program["name"], uid=uid
|
||||
),
|
||||
|
@ -169,9 +169,9 @@ async def async_setup_entry(
|
|||
entities.extend(
|
||||
[
|
||||
RainMachineZone(
|
||||
entry,
|
||||
zones_coordinator,
|
||||
controller,
|
||||
entry,
|
||||
RainMachineSwitchDescription(
|
||||
key=f"RainMachineZone_{uid}", name=zone["name"], uid=uid
|
||||
),
|
||||
|
@ -191,13 +191,13 @@ class RainMachineSwitch(RainMachineEntity, SwitchEntity):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
entry: ConfigEntry,
|
||||
coordinator: DataUpdateCoordinator,
|
||||
controller: Controller,
|
||||
entry: ConfigEntry,
|
||||
description: RainMachineSwitchDescription,
|
||||
) -> None:
|
||||
"""Initialize a generic RainMachine switch."""
|
||||
super().__init__(coordinator, controller, description)
|
||||
super().__init__(entry, coordinator, controller, description)
|
||||
|
||||
self._attr_is_on = False
|
||||
self._data = coordinator.data[self.entity_description.uid]
|
||||
|
|
Loading…
Reference in New Issue