Skip to content

Commit f874ba1

Browse files
authored
Move device_info to attribute in vesync (home-assistant#157462)
1 parent 4fc125c commit f874ba1

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

homeassistant/components/vesync/entity.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ def __init__(
2121
super().__init__(coordinator)
2222
self.device = device
2323
self._attr_unique_id = self.base_unique_id
24+
self._attr_device_info = DeviceInfo(
25+
identifiers={(DOMAIN, self.base_unique_id)},
26+
name=self.device.device_name,
27+
model=self.device.device_type,
28+
manufacturer="VeSync",
29+
sw_version=self.device.current_firm_version,
30+
)
2431

2532
@property
2633
def base_unique_id(self):
@@ -36,14 +43,3 @@ def base_unique_id(self):
3643
def available(self) -> bool:
3744
"""Return True if device is available."""
3845
return self.device.state.connection_status == "online"
39-
40-
@property
41-
def device_info(self) -> DeviceInfo:
42-
"""Return device information."""
43-
return DeviceInfo(
44-
identifiers={(DOMAIN, self.base_unique_id)},
45-
name=self.device.device_name,
46-
model=self.device.device_type,
47-
manufacturer="VeSync",
48-
sw_version=self.device.current_firm_version,
49-
)

0 commit comments

Comments
 (0)