Fix ESP32 touch sleep duration conversion

This commit is contained in:
Otto Winter 2018-06-06 09:30:14 +02:00
parent e650473682
commit c82a44d541
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E

View file

@ -65,7 +65,7 @@ def to_code(config):
if CONF_IIR_FILTER in config: if CONF_IIR_FILTER in config:
add(touch.set_iir_filter(config[CONF_IIR_FILTER])) add(touch.set_iir_filter(config[CONF_IIR_FILTER]))
if CONF_SLEEP_DURATION in config: if CONF_SLEEP_DURATION in config:
sleep_duration = int(config[CONF_SLEEP_DURATION].total_microseconds * 6.6667) sleep_duration = int(config[CONF_SLEEP_DURATION].total_microseconds * 0.15)
add(touch.set_sleep_duration(sleep_duration)) add(touch.set_sleep_duration(sleep_duration))
if CONF_MEASUREMENT_DURATION in config: if CONF_MEASUREMENT_DURATION in config:
measurement_duration = int(config[CONF_MEASUREMENT_DURATION].total_microseconds * 0.125) measurement_duration = int(config[CONF_MEASUREMENT_DURATION].total_microseconds * 0.125)