Mixiaoxiao / Arduino-HomeKit-ESP8266

Native Apple HomeKit accessory implementation for the ESP8266 Arduino core.
MIT License
1.53k stars 280 forks source link

Change the fan to percentage type #260

Open guangmin0622 opened 1 week ago

guangmin0622 commented 1 week ago

The fan in the example is shown as a switch type on Homekit. Can it be changed to percentage type?

homekit_accessory_t accessories[] = { HOMEKIT_ACCESSORY( .id = 1, // 配件 ID .category = homekit_accessory_category_fan, // 配件類別為風扇 .services = (homekit_service_t[]) { HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics = (homekit_characteristic_t[]) { &name, // 配件名稱 HOMEKIT_CHARACTERISTIC(MANUFACTURER, ACCESSORY_MANUFACTURER), // 製造商 HOMEKIT_CHARACTERISTIC(SERIAL_NUMBER, ACCESSORY_SN), // 配件序列號 HOMEKIT_CHARACTERISTIC(MODEL, ACCESSORY_MODEL), // 配件型號 HOMEKIT_CHARACTERISTIC(IDENTIFY, accessory_identify), // 識別功能 NULL }), HOMEKIT_SERVICE(FAN, .primary=true, .characteristics = (homekit_characteristic_t[]) { &fan_on_characteristic, // 風扇開關特性 NULL }), NULL } ), NULL };

LouisLee985 commented 2 days ago

&rotation_speed,