Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Dec 22, 2024
1 parent 26f5ec0 commit 76571f1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/types/devicestatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ export type meterProStatus = deviceStatus & {
temperature: number
battery: number
humidity: number
version: string
}

export type meterProCO2Status = deviceStatus & {
temperature: number
battery: number
humidity: number
co2: number
version: string
CO2: number
}

export type outdoorMeterStatus = deviceStatus & {
Expand Down Expand Up @@ -192,6 +194,7 @@ export type hub2Status = deviceStatus & {

export type batteryCirculatorFanStatus = deviceStatus & {
mode: 'direct' | 'natural' | 'sleep' | 'baby'
version: string
battery: number
power: string
nightStatus: number
Expand All @@ -200,3 +203,13 @@ export type batteryCirculatorFanStatus = deviceStatus & {
chargingStatus: string
fanSpeed: number
}

export type circulatorFanStatus = deviceStatus & {
mode: 'direct' | 'natural' | 'sleep' | 'baby'
version: string
power: string
nightStatus: number
oscillation: string
verticalOscillation: string
fanSpeed: number
}
22 changes: 21 additions & 1 deletion src/types/devicewebhookstatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ export type curtain3WebhookContext = deviceWebhookContext & {

export type motionSensorWebhookContext = deviceWebhookContext & {
detectionState: 'NOT_DETECTED' | 'DETECTED'
battery: number // 0~100
}

export type contactSensorWebhookContext = deviceWebhookContext & {
detectionState: 'NOT_DETECTED' | 'DETECTED'
battery: number // 0~100
doorMode: 'IN_DOOR' | 'OUT_DOOR'
brightness: 'dim' | 'bright'
openState: 'open' | 'close' | 'timeOutNotClose'
Expand All @@ -93,41 +95,48 @@ export type waterLeakDetectorWebhookContext = deviceWebhookContext & {

export type meterWebhookContext = deviceWebhookContext & {
temperature: number
battery: number // 0~100
scale: 'CELSIUS' | 'FAHRENHEIT'
humidity: number
}

export type meterPlusWebhookContext = deviceWebhookContext & {
temperature: number
battery: number // 0~100
scale: 'CELSIUS' | 'FAHRENHEIT'
humidity: number
}

export type meterProWebhookContext = deviceWebhookContext & {
temperature: number
battery: number // 0~100
scale: 'CELSIUS' | 'FAHRENHEIT'
humidity: number
}

export type meterProCO2WebhookContext = deviceWebhookContext & {
temperature: number
battery: number // 0~100
scale: 'CELSIUS' | 'FAHRENHEIT'
humidity: number
co2: number
CO2: number
}

export type outdoorMeterWebhookContext = deviceWebhookContext & {
temperature: number
battery: number // 0~100
scale: 'CELSIUS' | 'FAHRENHEIT'
humidity: number
}

export type lockWebhookContext = deviceWebhookContext & {
lockState: 'UNLOCKED' | 'LOCKED' | 'JAMMED'
battery: number // 0~100
}

export type lockProWebhookContext = deviceWebhookContext & {
lockState: 'UNLOCKED' | 'LOCKED' | 'JAMMED'
battery: number // 0~100
}

export type indoorCameraWebhookContext = deviceWebhookContext & {
Expand Down Expand Up @@ -226,6 +235,17 @@ export type batteryCirculatorFanWebhookContext = deviceWebhookContext & {
fanSpeed: number // 1~100
}

export type circulatorFanWebhookContext = deviceWebhookContext & {
mode: 'direct' | 'natural' | 'sleep' | 'baby'
version: string
battery: number
powerState: 'ON' | 'OFF'
nightStatus: 'off' | 1 | 2
oscillation: 'on' | 'off'
verticalOscillation: 'on' | 'off'
fanSpeed: number // 1~100
}

export type blindTiltWebhookContext = deviceWebhookContext & {
version: string
calibrate: boolean
Expand Down
3 changes: 3 additions & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export enum SwitchBotModel {
PanTiltCam2K = 'W3101100',
BlindTilt = 'W2701600',
BatteryCirculatorFan = 'W3800510',
CirculatorFan = 'W3800511',
WaterDetector = 'W4402000',
Unknown = 'Unknown',
}
Expand Down Expand Up @@ -167,6 +168,8 @@ export enum SwitchBotBLEModelFriendlyName {
MeterPlus = 'Meter Plus',
MeterPro = 'Meter Pro',
MeterProCO2 = 'Meter Pro CO2',
BatteryCirculatorFan = 'Battery Circulator Fan',
CirculatorFan = 'Circulator Fan',
OutdoorMeter = 'Outdoor Meter',
ContactSensor = 'Contact Sensor',
MotionSensor = 'Motion Sensor',
Expand Down

0 comments on commit 76571f1

Please sign in to comment.