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