Skip to content

Commit

Permalink
Update Disk model for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Jan 2, 2025
1 parent 195e580 commit 9c7002b
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions pyudisk/models/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,94 @@ class PowerOnTime(BaseModel):
hours: Optional[int] = None


class WWN(BaseModel):
naa: Optional[int] = None
oui: Optional[int] = None
id: Optional[int] = None


class UserCapacity(BaseModel):
blocks: Optional[int] = None
bytes: Optional[int] = None


class Trim(BaseModel):
supported: Optional[bool] = None
deterministic: Optional[bool] = None
zeroed: Optional[bool] = None


class ATAVersion(BaseModel):
string: Optional[str] = None
major_value: Optional[int] = None
minor_value: Optional[int] = None


class SATAVersion(BaseModel):
string: Optional[str] = None
value: Optional[int] = None


class InterfaceSpeedOptions(BaseModel):
sata_value: Optional[int] = None
string: Optional[str] = None
units_per_second: Optional[int] = None
bits_per_unit: Optional[int] = None


class InterfaceSpeed(BaseModel):
max: Optional[InterfaceSpeedOptions] = None
current: Optional[InterfaceSpeedOptions] = None


class ODCStatus(BaseModel):
value: Optional[int] = None
string: Optional[int] = None


class STStatus(BaseModel):
value: Optional[int] = None
string: Optional[int] = None
passed: Optional[bool] = None


class OfflineDataCollection(BaseModel):
status: Optional[ODCStatus] = None
completion_seconds: Optional[int] = None


class PollingMinutes(BaseModel):
short: Optional[int] = None
extended: Optional[int] = None


class SelfTest(BaseModel):
status: Optional[STStatus] = None
polling_minutes: Optional[PollingMinutes] = None


class Capabilities(BaseModel):
values: List[int] = None
exec_offline_immediate_supported: Optional[bool] = None
offline_is_aborted_upon_new_cmd: Optional[bool] = None
offline_surface_scan_supported: Optional[bool] = None
self_tests_supported: Optional[bool] = None
conveyance_self_test_supported: Optional[bool] = None
selective_self_test_supported: Optional[bool] = None
attribute_autosave_enabled: Optional[bool] = None
error_logging_supported: Optional[bool] = None
gp_logging_supported: Optional[bool] = None


class ATASmartData(BaseModel):
offline_data_collection: Optional[OfflineDataCollection] = None
self_test: Optional[SelfTest] = None
capabilities: Optional[Capabilities] = None


# Continue with ata_smart_attributes..


class Disk(BaseModel):
"""Collective disk information.
Expand All @@ -166,16 +254,28 @@ class Disk(BaseModel):
smartctl: Optional[SmartCTL] = None
local_time: Optional[LocalTime] = None
device: Optional[Device] = None
model_family: Optional[str] = None
model_name: Optional[str] = None
serial_number: Optional[str] = None
wwn: Optional[WWN] = None
firmware_version: Optional[str] = None
user_capacity: Optional[UserCapacity] = None
logical_block_size: Optional[int] = None
physical_block_size: Optional[int] = None
rotation_rate: Optional[int] = None
trim: Optional[Trim] = None
in_smartctl_database: Optional[bool] = None
ata_version: Optional[ATAVersion] = None
sata_version: Optional[SATAVersion] = None
interface_speed: Optional[InterfaceSpeed] = None
nvme_pci_vendor: Optional[NvmePciVendor] = None
nvme_ieee_oui_identifier: Optional[int] = None
nvme_controller_id: Optional[int] = None
nvme_version: Optional[NvmeVersion] = None
nvme_number_of_namespaces: Optional[int] = None
smart_support: Optional[SmartSupport] = None
smart_status: Optional[SmartStatus] = None
ata_smart_data: Optional[ATASmartData] = None
nvme_smart_health_information_log: Optional[NvmeSmartHealthInformationLog] = None
temperature: Optional[Temperature] = None
power_cycle_count: Optional[int] = None
Expand Down

0 comments on commit 9c7002b

Please sign in to comment.