Skip to content

Commit 8d5523e

Browse files
committed
Add device_info
Added device_info so the switch gets assigned to the device properly
1 parent 9495e17 commit 8d5523e

File tree

9 files changed

+6
-1
lines changed

9 files changed

+6
-1
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

custom_components/daikinskyport/switch.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from homeassistant.components.switch import SwitchEntity
55
from homeassistant.config_entries import ConfigEntry
66
from homeassistant.core import HomeAssistant
7+
from homeassistant.helpers.device_registry import DeviceInfo
78
from homeassistant.exceptions import HomeAssistantError
89
from homeassistant.helpers.entity_platform import AddEntitiesCallback
910

@@ -20,7 +21,7 @@
2021
async def async_setup_entry(
2122
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
2223
) -> None:
23-
"""Add a Daikin Skyport Weather entity from a config_entry."""
24+
"""Add a Daikin Skyport Switch entity from a config_entry."""
2425

2526
data = hass.data[DOMAIN][entry.entry_id]
2627
coordinator: DaikinSkyportData = data[COORDINATOR]
@@ -69,6 +70,10 @@ def turn_off(self, **kwargs: Any) -> None:
6970
self.aux_on = False
7071
self.async_write_ha_state()
7172

73+
@property
74+
def device_info(self) -> DeviceInfo:
75+
return self.data.device_info
76+
7277
async def async_update(self) -> None:
7378
"""Get the latest state of the switch."""
7479
_LOGGER.debug("Updating switch entity")

0 commit comments

Comments
 (0)