@switchbot/homebridge-switchbot 2.0.0-beta.36 → 2.0.0-beta.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,9 @@ All notable changes to this project will be documented in this file. This projec
14
14
  - `OpenAPI` will only allow connections through the OpenAPI.
15
15
  - `BLE` will only allow connections through Bluetooth (BLE), .
16
16
  - `Disable` will disable all connections. This will also allow you to disable commands and refreshes for a specific device but leave it in HomeKit.
17
+ - Added Support for Ceiling Light & Ceiling Light Pro
18
+ - Fixes Smart Lock Issues fixed in v1.1 of OpenAPI. [#462](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/462)
19
+ = Fixes excesive logging from node-switchbot. [#435](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/435), [#444](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/444), [#446](https://github.com/OpenWonderLabs/homebridge-switchbot/issues/446)
17
20
  - Housekeeping and updated dependencies.
18
21
 
19
22
  **Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.15.0...v2.0.0
package/README.md CHANGED
@@ -96,6 +96,8 @@
96
96
  - Must supply `deviceId` & `deviceName` to Device Config
97
97
  - Check `Enable Bluetooth Low Energy (BLE) Connection` on Device Config
98
98
  - [SwitchBot Bulb](https://www.switch-bot.com/products/switchbot-color-bulb)
99
+ - [SwitchBot Ceiling Light](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
100
+ - [SwitchBot Ceiling Light Pro](https://www.switchbot.jp/collections/all/products/switchbot-ceiling-light)
99
101
  - [SwitchBot Light Strip](https://www.switch-bot.com/products/switchbot-light-strip)
100
102
  - Supports OpenAPI Connection Only
101
103
  - If using OpenAPI:
@@ -0,0 +1,137 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Context } from 'vm';
4
+ import { IncomingMessage } from 'http';
5
+ import { Subject } from 'rxjs';
6
+ import { SwitchBotPlatform } from '../platform';
7
+ import { Service, PlatformAccessory, CharacteristicValue, ControllerConstructor, Controller, ControllerServiceMap } from 'homebridge';
8
+ import { device, devicesConfig, deviceStatus, switchbot, serviceData, ad } from '../settings';
9
+ /**
10
+ * Platform Accessory
11
+ * An instance of this class is created for each accessory your platform registers
12
+ * Each accessory may expose multiple services of different service types.
13
+ */
14
+ export declare class CeilingLight {
15
+ private readonly platform;
16
+ private accessory;
17
+ device: device & devicesConfig;
18
+ lightBulbService: Service;
19
+ On: CharacteristicValue;
20
+ Hue: CharacteristicValue;
21
+ Saturation: CharacteristicValue;
22
+ Brightness: CharacteristicValue;
23
+ ColorTemperature?: CharacteristicValue;
24
+ power: deviceStatus['power'];
25
+ color: deviceStatus['color'];
26
+ brightness: deviceStatus['brightness'];
27
+ colorTemperature?: deviceStatus['colorTemperature'];
28
+ deviceStatus: any;
29
+ connected?: boolean;
30
+ switchbot: switchbot;
31
+ address: ad['address'];
32
+ serviceData: serviceData;
33
+ state: serviceData['state'];
34
+ delay: serviceData['delay'];
35
+ wifiRssi: serviceData['wifiRssi'];
36
+ set_minStep?: number;
37
+ scanDuration: number;
38
+ deviceLogging: string;
39
+ deviceRefreshRate: number;
40
+ adaptiveLightingShift?: number;
41
+ AdaptiveLightingController?: ControllerConstructor | Controller<ControllerServiceMap>;
42
+ minKelvin: number;
43
+ maxKelvin: number;
44
+ cacheKelvin: number;
45
+ ceilingLightUpdateInProgress: boolean;
46
+ doCeilingLightUpdate: Subject<void>;
47
+ private readonly BLE;
48
+ private readonly OpenAPI;
49
+ constructor(platform: SwitchBotPlatform, accessory: PlatformAccessory, device: device & devicesConfig);
50
+ private model;
51
+ /**
52
+ * Parse the device status from the SwitchBot api
53
+ */
54
+ parseStatus(): Promise<void>;
55
+ BLEparseStatus(): Promise<void>;
56
+ openAPIparseStatus(): Promise<void>;
57
+ /**
58
+ * Asks the SwitchBot API for the latest device information
59
+ */
60
+ refreshStatus(): Promise<void>;
61
+ BLERefreshStatus(): Promise<void>;
62
+ openAPIRefreshStatus(): Promise<void>;
63
+ /**
64
+ * Pushes the requested changes to the SwitchBot API
65
+ * deviceType commandType Command command parameter Description
66
+ * Color Bulb - "command" "turnOff" "default" = set to OFF state
67
+ * Color Bulb - "command" "turnOn" "default" = set to ON state
68
+ * Color Bulb - "command" "toggle" "default" = toggle state
69
+ * Color Bulb - "command" "setBrightness" "{1-100}" = set brightness
70
+ * Color Bulb - "command" "setColor" "{0-255}:{0-255}:{0-255}" = set RGB color value
71
+ * Color Bulb - "command" "setColorTemperature" "{2700-6500}" = set color temperature
72
+ *
73
+ */
74
+ pushChanges(): Promise<void>;
75
+ BLEpushChanges(): Promise<void>;
76
+ openAPIpushChanges(): Promise<void>;
77
+ pushHueSaturationChanges(): Promise<void>;
78
+ pushColorTemperatureChanges(): Promise<void>;
79
+ pushBrightnessChanges(): Promise<void>;
80
+ /**
81
+ * Handle requests to set the value of the "On" characteristic
82
+ */
83
+ OnSet(value: CharacteristicValue): Promise<void>;
84
+ /**
85
+ * Handle requests to set the value of the "Brightness" characteristic
86
+ */
87
+ BrightnessSet(value: CharacteristicValue): Promise<void>;
88
+ /**
89
+ * Handle requests to set the value of the "ColorTemperature" characteristic
90
+ */
91
+ ColorTemperatureSet(value: CharacteristicValue): Promise<void>;
92
+ /**
93
+ * Handle requests to set the value of the "Hue" characteristic
94
+ */
95
+ HueSet(value: CharacteristicValue): Promise<void>;
96
+ /**
97
+ * Handle requests to set the value of the "Saturation" characteristic
98
+ */
99
+ SaturationSet(value: CharacteristicValue): Promise<void>;
100
+ updateHomeKitCharacteristics(): Promise<void>;
101
+ adaptiveLighting(device: device & devicesConfig): Promise<void>;
102
+ getCustomBLEAddress(switchbot: any): Promise<void>;
103
+ BLEPushConnection(): Promise<void>;
104
+ BLERefreshConnection(switchbot: any): Promise<void>;
105
+ turnOnOff(device_list: any): Promise<any>;
106
+ retry({ max, fn }: {
107
+ max: number;
108
+ fn: {
109
+ (): any;
110
+ (): Promise<any>;
111
+ };
112
+ }): Promise<null>;
113
+ maxRetry(): Promise<number>;
114
+ minStep(device: device & devicesConfig): number;
115
+ scan(device: device & devicesConfig): Promise<void>;
116
+ statusCode({ res }: {
117
+ res: IncomingMessage;
118
+ }): Promise<void>;
119
+ offlineOff(): Promise<void>;
120
+ apiError(e: any): void;
121
+ FirmwareRevision(accessory: PlatformAccessory<Context>, device: device & devicesConfig): CharacteristicValue;
122
+ private context;
123
+ refreshRate(device: device & devicesConfig): Promise<void>;
124
+ config(device: device & devicesConfig): Promise<void>;
125
+ logs(device: device & devicesConfig): Promise<void>;
126
+ /**
127
+ * Logging for Device
128
+ */
129
+ infoLog(...log: any[]): void;
130
+ warnLog(...log: any[]): void;
131
+ debugWarnLog(...log: any[]): void;
132
+ errorLog(...log: any[]): void;
133
+ debugErrorLog(...log: any[]): void;
134
+ debugLog(...log: any[]): void;
135
+ enablingDeviceLogging(): boolean;
136
+ }
137
+ //# sourceMappingURL=ceilinglight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ceilinglight.d.ts","sourceRoot":"","sources":["../../src/device/ceilinglight.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAY,OAAO,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACtI,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAwB,WAAW,EAAE,EAAE,EAA0B,MAAM,aAAa,CAAC;AAE5I;;;;GAIG;AACH,qBAAa,YAAY;IAkDX,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAAqB,OAAO,CAAC,SAAS;IAA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