esphome/esphome
Andrew Zaborowski 2f07225984
Fix: Component script not stopped in certain situations (#1004)
* Move stop/is_running implementation to Action base class

Try to fix issue #1105.  Until now if an UpdateComponentAction, a
LambdaAction, or any action that can contain those inside their
"else" or "then" action lists, resulted in a call to script.stop on
the script that contains them, the script would continue running,
because they didn't implement a stop() method.  Basically only
the asynchronous ones did: DelayAction, WaitUntilAction and
ScriptWaitAction.

With this change num_running_ in Action replaces
DelayAction::num_running_ and WaitUntilAction::triggered_ to provide
the same is_running logic to other actions.

* Make some Action methods protected

Apparently play()/stop() etc. are not meant to be called directly by
users of the class and if they're called directly that would not give
the expected result for the classes that have an empty play().

Make all methods except play_complex, stop_comples and is_running
protected.  While there also make RemoteTransmitterActionBase::encode
protected.

* lint

* format

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2020-06-28 19:44:15 -03:00
..
api Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
components Fix: Component script not stopped in certain situations (#1004) 2020-06-28 19:44:15 -03:00
core Fix: Component script not stopped in certain situations (#1004) 2020-06-28 19:44:15 -03:00
dashboard Dashboard Updates (#1025) 2020-04-29 10:04:05 -03:00
__init__.py Rename esphomeyaml to esphome (#426) 2019-02-13 16:54:02 +01:00
__main__.py Add support for command-line substitutions (#1014) 2020-06-21 15:33:01 -03:00
automation.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
codegen.py Logger on_message trigger (#729) 2019-10-24 14:19:33 +02:00
config.py Add support for command-line substitutions (#1014) 2020-06-21 15:33:01 -03:00
config_helpers.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
config_validation.py fix percentage handling (#1094) 2020-06-19 20:59:19 -03:00
const.py Add support for ST7789V display module (as on TTGO T-Display) (#1050) 2020-06-28 18:37:36 -03:00
core.py Upgrade dependencies 2020-05-23 20:33:58 -03:00
core_config.py Upgrade dependencies 2020-05-23 20:33:58 -03:00
cpp_generator.py Upgrade dependencies 2020-05-23 20:33:58 -03:00
cpp_helpers.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
cpp_types.py Logger on_message trigger (#729) 2019-10-24 14:19:33 +02:00
espota2.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
helpers.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
legacy.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
mqtt.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
pins.py Add huzzah gpio pins (#1096) 2020-06-19 13:02:59 -03:00
platformio_api.py Bugfix/1077 decode called on str fetching platformio stacktrace (#991) 2020-03-11 17:22:45 -07:00
py_compat.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
storage_json.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
symlink_ops.py Better symlink support under Windows (#487) 2019-03-23 22:58:25 +01:00
util.py Bugfix/1077 decode called on str fetching platformio stacktrace (#991) 2020-03-11 17:22:45 -07:00
voluptuous_schema.py Upgrade dependencies 2020-05-23 20:33:58 -03:00
vscode.py Add support for command-line substitutions (#1014) 2020-06-21 15:33:01 -03:00
wizard.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00
writer.py Revert ESP32 default upload speed to 115200 (#978) 2020-02-15 20:48:08 -03:00
yaml_util.py Sort keys in dicts in output yaml for 'config' command (#1049) 2020-06-09 00:10:49 -03:00
zeroconf.py Drop Python 2 Support (#793) 2019-12-07 18:28:55 +01:00