mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 00:35:44 +00:00
Add Wifi info text sensor (#473)
* Add WiFi Info text sensor * Lint * Fix register * Add newline at end of file
This commit is contained in:
@@ -56,9 +56,10 @@ def setup_text_sensor(text_sensor_obj, config):
|
||||
|
||||
|
||||
def register_text_sensor(var, config):
|
||||
text_sensor_var = Pvariable(config[CONF_ID], var, has_side_effects=True)
|
||||
add(App.register_text_sensor(text_sensor_var))
|
||||
CORE.add_job(setup_text_sensor_core_, text_sensor_var, config)
|
||||
if not CORE.has_id(config[CONF_ID]):
|
||||
var = Pvariable(config[CONF_ID], var, has_side_effects=True)
|
||||
add(App.register_text_sensor(var))
|
||||
CORE.add_job(setup_text_sensor_core_, var, config)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_TEXT_SENSOR'
|
||||
|
||||
Reference in New Issue
Block a user