ollo69 / ha_tuya_custom

Tuya Custom Component for testing
Apache License 2.0
39 stars 18 forks source link

Allow climate device hvac_modes default override #33

Open maforshaw opened 4 years ago

maforshaw commented 4 years ago

If the integration cannot determine the hvac_modes of a climate device from the API, it defaults to: off, heat_cool

        if modes is None:
            if HVAC_MODE_HEAT_COOL not in self.operations:
                self.operations.append(HVAC_MODE_HEAT_COOL)
            return

For my device, a heater, that's actually wrong and it should be HVAC_MODE_HEAT. It would therefore be good if the default value could be set via the config rather than hard-coded to HVAC_MODE_HEAT_COOL.

ollo69 commented 4 years ago

I used HVAC_MODE_HEAT_COOL because is generic, anyway I will keep in consideration your request for future releases.

maforshaw commented 4 years ago

Thanks, it's a minor detail. I noticed it because the Thermostat Card displays the wrong icon since it uses hvac_modes to determine what to use. Also, the documentation for Climate says you must not set Temperature in climate.set_temperature if hvac_mode is heat_cool, which is actually incorrect in my case because that's all you can set.