maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.12k stars 170 forks source link

The range does not match the actual environment #139

Closed CHNleing closed 4 years ago

CHNleing commented 4 years ago

Ask a question, the air conditioning temperature range: 16-30. I use HEATER_COOLER range is 0-100, 0-25. How to change this range. In line with air conditioning.

pbendersky commented 4 years ago

When you create the characteristic, you can add a min_value and a max_value. Here's mine, for a HEATER_COOLER:

            HOMEKIT_CHARACTERISTIC(
                COOLING_THRESHOLD_TEMPERATURE, 0,
                .getter=ac_cooling_threshold_get,
                .setter=ac_cooling_threshold_set,
                .min_value = (float[]) {16},
                .max_value = (float[]) {30},
                .min_step = (float[]) {1}
            ),
CHNleing commented 4 years ago

@pbendersky And how to get characteristics in real time. After the cooling is set, the heating status is still displayed, and the cooling will be displayed only when you exit the home APP and reopen it. Please advise, thank you

CHNleing commented 4 years ago

When I use the remote control to turn off the air conditioner, I must quit the home app and then open the app to see the correct status

CHNleing commented 4 years ago

solved

peros550 commented 4 years ago

I have a working example of AC here

You may want to have a look if you like.