2025-10-28 01:11:57 +00:00
|
|
|
export const ZIGBEE_BASE_TOPIC = "nexus"
|
|
|
|
|
|
|
|
|
|
export const ZIGBEE_DEVICE = {
|
|
|
|
|
deskLamp: "desk_lamp",
|
|
|
|
|
livingRoomFloorLamp: "living_room_floor_lamp",
|
|
|
|
|
} as const
|
|
|
|
|
|
|
|
|
|
export type ZigbeeDeviceStates = {
|
|
|
|
|
[ZIGBEE_DEVICE.deskLamp]: {
|
|
|
|
|
state: "ON" | "OFF"
|
|
|
|
|
brightness: number
|
|
|
|
|
}
|
|
|
|
|
[ZIGBEE_DEVICE.livingRoomFloorLamp]: {
|
|
|
|
|
brightness: number
|
|
|
|
|
level_config: {
|
|
|
|
|
on_level: "previous"
|
|
|
|
|
}
|
|
|
|
|
linkquality: number
|
|
|
|
|
state: "ON" | "OFF"
|
|
|
|
|
update: {
|
|
|
|
|
installed_version: number
|
|
|
|
|
latest_version: number
|
|
|
|
|
state: "available" | "idle"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-30 00:13:08 +00:00
|
|
|
export type ZigbeeDeviceName = keyof ZigbeeDeviceStates
|
|
|
|
|
|
|
|
|
|
export type ZigbeeDeviceState<DeviceName extends ZigbeeDeviceName = ZigbeeDeviceName> = ZigbeeDeviceStates[DeviceName]
|
2025-10-28 01:11:57 +00:00
|
|
|
|
2025-10-30 00:13:08 +00:00
|
|
|
export const ALL_ZIGBEE_DEVICE_NAMES: ZigbeeDeviceName[] = Object.values(ZIGBEE_DEVICE)
|