Skip to content

Commit

Permalink
Update for HA2023.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Sep 18, 2023
1 parent b9fe492 commit 69aed09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions custom_components/portainer/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,21 @@ def device_info(self) -> DeviceInfo:
dev_connection_value = dev_connection_value[6:]
dev_connection_value = self._data[dev_connection_value]

return DeviceInfo(
connections={(dev_connection, f"{dev_connection_value}")},
identifiers={(dev_connection, f"{dev_connection_value}")},
default_name=f"{self._inst} {dev_group}",
default_manufacturer=f"{self.manufacturer}",
sw_version=f"{self.sw_version}",
configuration_url=f"http://{self.coordinator.config_entry.data[CONF_HOST]}",
)
if self.description.ha_group == "System":
return DeviceInfo(
connections={(dev_connection, f"{dev_connection_value}")},
identifiers={(dev_connection, f"{dev_connection_value}")},
name=f"{self._inst} {dev_group}",
manufacturer=f"{self.manufacturer}",
sw_version=f"{self.sw_version}",
configuration_url=f"http://{self.coordinator.config_entry.data[CONF_HOST]}",
)
else:
return DeviceInfo(
connections={(dev_connection, f"{dev_connection_value}")},
default_name=f"{self._inst} {dev_group}",
default_manufacturer=f"{self.manufacturer}",
)

@property
def extra_state_attributes(self) -> Mapping[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Portainer",
"homeassistant": "2022.2.0",
"homeassistant": "2023.9.0",
"render_readme": false,
"zip_release": true,
"filename": "portainer.zip"
Expand Down

0 comments on commit 69aed09

Please sign in to comment.