mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +01:00
460a144ca8
The Amphenol T6615 has a built-in calibration system which means that the sensor could go away for a couple of seconds to figure itself out. While this is happening, commands are silently dropped. This caused the previous version of this code to lock up completely, since there was no way for the command_ state machine to tick back to the NONE state. Instead of just breaking the state machine, which might be harmful on a multi-core or multi-threaded device, add a timestamp and only break the lock if it's been more than a second since the command was issued. The command usually doesn't take more than a few milliseconds to complete, so this should not affect things unduly. While we're at it, rewrite the rx side to be more robust against bytes going missing. Instead of reading in the data essentially inline, read into a buffer and process it when enough has been read to make progress. If data stops coming when we expect it to, or the data is malformed, have a timeout that sends a new command. Co-authored-by: jas <jas@asspa.in> |
||
---|---|---|
.. | ||
api | ||
components | ||
core | ||
dashboard | ||
__init__.py | ||
__main__.py | ||
automation.py | ||
boards.py | ||
codegen.py | ||
config_helpers.py | ||
config_validation.py | ||
config.py | ||
const.py | ||
coroutine.py | ||
cpp_generator.py | ||
cpp_helpers.py | ||
cpp_types.py | ||
espota2.py | ||
final_validate.py | ||
git.py | ||
helpers.py | ||
jsonschema.py | ||
loader.py | ||
log.py | ||
mqtt.py | ||
pins.py | ||
platformio_api.py | ||
storage_json.py | ||
types.py | ||
util.py | ||
voluptuous_schema.py | ||
vscode.py | ||
wizard.py | ||
writer.py | ||
yaml_util.py | ||
zeroconf.py |