1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-19 04:20:56 +00:00
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
2019-11-01 11:50:36 +01:00
2020-06-13 19:51:43 -03:00
2020-04-30 23:00:57 -03:00
2020-06-28 18:47:43 -03:00
2018-09-25 10:30:45 +02:00
2019-05-08 15:37:18 +02:00
2019-10-20 17:56:57 +02:00
2020-05-23 20:33:58 -03:00
2019-12-07 18:28:55 +01:00
2019-02-14 13:49:22 +01:00
2020-05-23 20:33:58 -03:00
2020-05-23 20:33:58 -03:00
2020-05-23 20:33:58 -03:00

ESPHome Build Status Discord Chat GitHub release

ESPHome Logo

Documentation: https://esphome.io/

For issues, please go to the issue tracker.

For feature requests, please see feature requests.

Description
No description provided
Readme Multiple Licenses 324 MiB
Languages
C++ 70.1%
Python 29.6%
C 0.1%