Skip to content

Commit

Permalink
Merge pull request #373 from dougiteixeira/ruff-fix-1
Browse files Browse the repository at this point in the history
Fix Ruff formatting
  • Loading branch information
dougiteixeira authored Dec 8, 2024
2 parents 6c7b669 + ebe71aa commit c34a8d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/proxmoxve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
{
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_TOKEN_NAME, default=''): cv.string,
vol.Optional(CONF_TOKEN_NAME, default=""): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_REALM, default=DEFAULT_REALM): cv.string,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/proxmoxve/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
SCHEMA_HOST_AUTH: vol.Schema = vol.Schema(
{
vol.Required(CONF_USERNAME): str,
vol.Optional(CONF_TOKEN_NAME, default=''): str,
vol.Optional(CONF_TOKEN_NAME, default=""): str,
vol.Required(CONF_PASSWORD): str,
vol.Optional(CONF_REALM, default=DEFAULT_REALM): str,
}
Expand Down
8 changes: 4 additions & 4 deletions custom_components/proxmoxve/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def _async_update_data(self) -> ProxmoxNodeData:
if (("cpuinfo" in api_status) and "model" in api_status["cpuinfo"])
else UNDEFINED,
status=api_status.get("status", "Offline"),
version=api_status["version"].get("version", UNDEFINED)
version=api_status["version"].get("version", UNDEFINED)
if ("version" in api_status)
else UNDEFINED,
uptime=api_status.get("uptime", UNDEFINED),
Expand Down Expand Up @@ -207,7 +207,7 @@ async def _async_update_data(self) -> ProxmoxNodeData:
if (("qemu" in api_status) and "total" in api_status["qemu"])
else 0,
qemu_on_list=api_status["qemu"]["list"]
if (("qemu" in api_status) and "list" in api_status["qemu"])
if (("qemu" in api_status) and "list" in api_status["qemu"])
else UNDEFINED,
lxc_on=api_status["lxc"]["total"]
if (("lxc" in api_status) and "total" in api_status["lxc"])
Expand Down Expand Up @@ -521,9 +521,9 @@ async def _async_update_data(self) -> ProxmoxUpdateData:
if node_api[CONF_NODE] == self.node_name:
node_status = node_api["status"]
break
if node_status == "":
if node_status == "":
node_status = "offline"
LOGGER.debug("Node %s status is %s", self.node_name, node_status)
LOGGER.debug("Node %s status is %s", self.node_name, node_status)

if node_status == "online":
if self.node_name is not None:
Expand Down

0 comments on commit c34a8d4

Please sign in to comment.