diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index 72951223d09..0fee1259349 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -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", diff --git a/homeassistant/components/rainmachine/binary_sensor.py b/homeassistant/components/rainmachine/binary_sensor.py index 7e886dbad90..78f3863dd16 100644 --- a/homeassistant/components/rainmachine/binary_sensor.py +++ b/homeassistant/components/rainmachine/binary_sensor.py @@ -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 ] ) diff --git a/homeassistant/components/rainmachine/sensor.py b/homeassistant/components/rainmachine/sensor.py index 57b51472a6f..4eec124f936 100644 --- a/homeassistant/components/rainmachine/sensor.py +++ b/homeassistant/components/rainmachine/sensor.py @@ -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 ] ) diff --git a/homeassistant/components/rainmachine/switch.py b/homeassistant/components/rainmachine/switch.py index bf84bc1f360..e693664bab4 100644 --- a/homeassistant/components/rainmachine/switch.py +++ b/homeassistant/components/rainmachine/switch.py @@ -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]