Task: Implement HaNoteStruct and ObjHealth enums with bidirectional conversion methods in the hax/types.py module, so the provided pytest tests for health-to-note and note-to-health conversions pass.
Requirements:
Create HaNoteStruct as an IntEnum with these members and int-valued codes:
M0_NC_ONLINE
M0_NC_FAILED
M0_NC_TRANSIENT
M0_NC_UNKNOWN
M0_NC_REPAIR
M0_NC_REPAIRED
M0_NC_REBALANCE
Create ObjHealth as an IntEnum with these members and int-valued codes:
OK
FAILED
OFFLINE
UNKNOWN
REPAIR
REPAIRED
REBALANCE
Implement a method on ObjHealth:
to_ha_note_status(self) -> HaNoteStruct
Mapping rules (based on tests):
OK -> M0_NC_ONLINE
FAILED -> M0_NC_FAILED
OFFLINE -> M0_NC_TRANSIENT
REPAIR -> M0_NC_REPAIR
REPAIRED -> M0_NC_REPAIRED
REBALANCE -> M0_NC_REBALANCE
For UNKNOWN health (not exercised by tests), provide a reasonable default (e.g., M0_NC_UNKNOWN) to avoid KeyError.