mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 16:47:57 +01:00
Allow for subsecond sampling of hmc5883l (#2735)
This commit is contained in:
parent
f1954df573
commit
b35f509784
@ -114,8 +114,8 @@ CONFIG_SCHEMA = (
|
|||||||
|
|
||||||
|
|
||||||
def auto_data_rate(config):
|
def auto_data_rate(config):
|
||||||
interval_sec = config[CONF_UPDATE_INTERVAL].seconds
|
interval_msec = config[CONF_UPDATE_INTERVAL].total_milliseconds
|
||||||
interval_hz = 1.0 / interval_sec
|
interval_hz = 1000.0 / interval_msec
|
||||||
for datarate in sorted(HMC5883LDatarates.keys()):
|
for datarate in sorted(HMC5883LDatarates.keys()):
|
||||||
if float(datarate) >= interval_hz:
|
if float(datarate) >= interval_hz:
|
||||||
return HMC5883LDatarates[datarate]
|
return HMC5883LDatarates[datarate]
|
||||||
|
Loading…
Reference in New Issue
Block a user