Skip to content

Commit

Permalink
Do not add the disk speed entity for SSD
Browse files Browse the repository at this point in the history
Do not add the disk speed entity for SSD
  • Loading branch information
dougiteixeira committed Jan 8, 2024
1 parent 1a805ba commit 21a3784
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/proxmoxve/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,17 +674,18 @@ async def _async_update_data(self) -> ProxmoxDiskData:
elif int(disk_attribute["id"].strip()) == 174:
disk_attributes["power_loss"] = disk_attribute["raw"]

disk_type=disk["type"] if "type" in disk else None
return ProxmoxDiskData(
type=ProxmoxType.Disk,
node=self.node_name,
path=self.resource_id,
vendor=disk["vendor"] if "vendor" in disk else None,
serial=disk["serial"] if "serial" in disk else None,
model=disk["model"] if "model" in disk else None,
disk_type=disk["type"] if "type" in disk else None,
disk_type=disk_type,
size=float(disk["size"]) if "size" in disk else UNDEFINED,
health=disk["health"] if "health" in disk else UNDEFINED,
disk_rpm=float(disk["rpm"]) if "rpm" in disk else UNDEFINED,
disk_rpm=float(disk["rpm"]) if ("rpm" in disk and disk_type.upper() not in ("SSD", None)) else UNDEFINED,
temperature_air=disk_attributes["temperature_air"]
if "temperature_air" in disk_attributes
else UNDEFINED,
Expand Down

0 comments on commit 21a3784

Please sign in to comment.