1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 13:13:50 +00:00

Allow id() syntax for custom code (#621)

* Allow id() syntax for custom code

* Lint
This commit is contained in:
Otto Winter
2019-06-07 14:26:17 +02:00
committed by GitHub
parent 726b0e73d9
commit 4fe0c95ccb
4 changed files with 20 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
#include "esphome/core/component.h"
#include "esphome/core/automation.h"
#include "esphome/core/helpers.h"
namespace esphome {
namespace globals {
@@ -64,5 +65,7 @@ template<class C, typename... Ts> class GlobalVarSetAction : public Action<Ts...
C *parent_;
};
template<typename T> T &id(GlobalsComponent<T> *value) { return value->value(); }
} // namespace globals
} // namespace esphome