esphome/esphome
Jas Strong 460a144ca8
t6615: tolerate sensor dropping commands (#2255)
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>
2021-09-14 23:06:13 +12:00
..
api Fix colorlog removing colors and refactor color code (#1671) 2021-04-08 13:58:01 +02:00
components t6615: tolerate sensor dropping commands (#2255) 2021-09-14 23:06:13 +12:00
core API encryption (#2254) 2021-09-09 09:22:47 +12:00
dashboard Remove removesuffix 2021-09-08 19:51:20 +12:00
__init__.py Rename esphomeyaml to esphome (#426) 2019-02-13 16:54:02 +01:00
__main__.py Only try compat parsing after regular parsing fails (#2269) 2021-09-14 23:06:13 +12:00
automation.py lambda condition should return (#1833) 2021-05-26 08:03:59 +12:00
boards.py Update known boards (#2190) 2021-08-30 09:41:05 +12:00
codegen.py Add variable bit width for Samsung protocol (#1927) 2021-06-18 13:54:46 +12:00
config_helpers.py add-black (#1593) 2021-03-07 16:03:16 -03:00
config_validation.py Allow using a git source for a package (#2193) 2021-09-06 08:23:06 +12:00
config.py Allow using a git source for a package (#2193) 2021-09-06 08:23:06 +12:00
const.py Bump version to 2021.9.0b3 2021-09-14 07:13:00 +12:00
coroutine.py Introduce new async-def coroutine syntax (#1657) 2021-05-17 17:14:15 +12:00
cpp_generator.py Support library override using named library with repository (#2056) 2021-07-26 10:50:45 +02:00
cpp_helpers.py Store source package in Component for debugging (#2070) 2021-08-24 06:49:19 +12:00
cpp_types.py Add variable bit width for Samsung protocol (#1927) 2021-06-18 13:54:46 +12:00
espota2.py Bump pylint from 2.7.2 to 2.8.2 (#1729) 2021-05-10 17:57:25 -03:00
final_validate.py Bump pylint from 2.8.2 to 2.9.4 (#2047) 2021-07-21 14:40:09 +12:00
git.py Allow using a git source for a package (#2193) 2021-09-06 08:23:06 +12:00
helpers.py Move to use zeroconf library instead of inline copy (#2192) 2021-09-06 08:22:15 +12:00
jsonschema.py schema-dump-pins (#1596) 2021-03-08 22:53:20 -03:00
loader.py Improve config final validation (#1917) 2021-06-18 11:52:02 +12:00
log.py Fix colorlog removing colors and refactor color code (#1671) 2021-04-08 13:58:01 +02:00
mqtt.py Fix colorlog removing colors and refactor color code (#1671) 2021-04-08 13:58:01 +02:00
pins.py Use proper schema for the analog pin shorthand (#2103) 2021-08-04 17:46:09 +02:00
platformio_api.py Initial ESP32-C3-DevKitM-1 board support (#2062) 2021-07-26 11:10:56 +02:00
storage_json.py Improve config final validation (#1917) 2021-06-18 11:52:02 +12:00
types.py Improve config final validation (#1917) 2021-06-18 11:52:02 +12:00
util.py Allow .yml files to show up in the dashboard (#2257) 2021-09-08 16:11:09 +12:00
voluptuous_schema.py Schema dump (#1564) 2021-03-07 21:05:08 -03:00
vscode.py Support multiple configuration directories for update-all subcommand (#1925) 2021-08-11 17:21:57 +12:00
wizard.py Initial ESP32-C3-DevKitM-1 board support (#2062) 2021-07-26 11:10:56 +02:00
writer.py Fix some lint errors in pylint 2.10.2 (#2226) 2021-08-31 14:00:58 +12:00
yaml_util.py Bump pylint from 2.8.2 to 2.9.4 (#2047) 2021-07-21 14:40:09 +12:00
zeroconf.py Fix runtime exception due to dict typing (#2243) 2021-09-06 14:48:28 +12:00