mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 04:12:23 +01:00
Sun support (#531)
* Sun * Add sun support * Lint * Updates * Fix elevation * Lint * Update mqtt_climate.cpp
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from esphome.const import CONF_INVERTED, CONF_MODE, CONF_NUMBER, CONF_SETUP_PRIORITY, \
|
||||
CONF_UPDATE_INTERVAL, CONF_TYPE_ID
|
||||
from esphome.core import coroutine
|
||||
from esphome.cpp_generator import RawExpression, add
|
||||
from esphome.core import coroutine, ID
|
||||
from esphome.cpp_generator import RawExpression, add, get_variable
|
||||
from esphome.cpp_types import App, GPIOPin
|
||||
|
||||
|
||||
@@ -42,6 +42,15 @@ def register_component(var, config):
|
||||
yield var
|
||||
|
||||
|
||||
@coroutine
|
||||
def register_parented(var, value):
|
||||
if isinstance(value, ID):
|
||||
paren = yield get_variable(value)
|
||||
else:
|
||||
paren = value
|
||||
add(var.set_parent(paren))
|
||||
|
||||
|
||||
def extract_registry_entry_config(registry, full_config):
|
||||
# type: (Registry, ConfigType) -> RegistryEntry
|
||||
key, config = next((k, v) for k, v in full_config.items() if k in registry)
|
||||
|
Reference in New Issue
Block a user