Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiteixeira committed Nov 12, 2023
1 parent bcc0e04 commit 8e6240f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions custom_components/proxmoxve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
DEFAULT_REALM,
DEFAULT_VERIFY_SSL,
DOMAIN,
INTEGRATION_TITLE,
LOGGER,
PROXMOX_CLIENT,
VERSION_REMOVE_YAML,
Expand Down Expand Up @@ -132,7 +133,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
severity=IssueSeverity.WARNING,
translation_key="yaml_deprecated",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"version": VERSION_REMOVE_YAML,
},
Expand All @@ -147,7 +148,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
severity=IssueSeverity.ERROR,
translation_key="import_invalid_port",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"host": conf.get[CONF_HOST],
"port": conf.get[CONF_PORT],
Expand Down Expand Up @@ -364,11 +365,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
severity=IssueSeverity.ERROR,
translation_key="resource_nonexistent",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"host": config_entry.data[CONF_HOST],
"port": config_entry.data[CONF_PORT],
"resource_type": "Node",
"resource_type": ProxmoxType.Node.capitalize(),
"resource": node,
},
)
Expand Down Expand Up @@ -400,11 +401,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
severity=IssueSeverity.ERROR,
translation_key="resource_nonexistent",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"host": config_entry.data[CONF_HOST],
"port": config_entry.data[CONF_PORT],
"resource_type": ProxmoxType.QEMU,
"resource_type": ProxmoxType.QEMU.upper(),
"resource": vm_id,
},
)
Expand Down Expand Up @@ -436,11 +437,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
severity=IssueSeverity.ERROR,
translation_key="resource_nonexistent",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"host": config_entry.data[CONF_HOST],
"port": config_entry.data[CONF_PORT],
"resource_type": ProxmoxType.LXC,
"resource_type": ProxmoxType.LXC.upper(),
"resource": container_id,
},
)
Expand Down Expand Up @@ -472,11 +473,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
severity=IssueSeverity.ERROR,
translation_key="resource_nonexistent",
translation_placeholders={
"integration": "Proxmox VE",
"integration": INTEGRATION_TITLE,
"platform": DOMAIN,
"host": config_entry.data[CONF_HOST],
"port": config_entry.data[CONF_PORT],
"resource_type": ProxmoxType.Storage,
"resource_type": ProxmoxType.Storage.capitalize(),
"resource": storage_id,
},
)
Expand Down Expand Up @@ -579,8 +580,8 @@ def device_info(
model_processor = coordinator_data.model
proxmox_version = f"Proxmox {coordinator_data.version}"

name = f"{api_category.capitalize()} {node}"
identifier = f"{config_entry.entry_id}_{api_category.upper()}_{node}"
name = f"{ProxmoxType.Node.capitalize()} {node}"
identifier = f"{config_entry.entry_id}_{ProxmoxType.Node.upper()}_{node}"
url = f"https://{host}:{port}/#v1:0:=node/{node}"
via_device = ("", "")
model = model_processor
Expand Down

0 comments on commit 8e6240f

Please sign in to comment.