mirror of
https://git.steelants.cz/JonatanRek/ESPHomeMarlin2.git
synced 2026-10-11 09:35:34 +00:00
Fixes
This commit is contained in:
1 parent
91f2dd54be
commit
cf3039439f
3 files changed
+111
-63
No files matched your search
+7
-1
@@ -13,13 +13,19 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
cv.Optional("printer_state"): text_sensor.text_sensor_schema(
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
cv.Optional("sd_card_files"): text_sensor.text_sensor_schema(
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
cv.Optional("sd_card_file_selected"): text_sensor.text_sensor_schema(
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
}
|
||||
).extend(cv.polling_component_schema("15s"))
|
||||
|
||||
async def to_code(config):
|
||||
server = await cg.get_variable(config[CONF_MARLIN])
|
||||
|
||||
for sName in ["printer_state"]:
|
||||
for sName in ["printer_state", "sd_card_files", "sd_card_file_selected"]:
|
||||
if sName in config:
|
||||
sens = await text_sensor.new_text_sensor(config[sName])
|
||||
cg.add(server.add_text_sensor(sName,sens))
|
||||
Reference in new issue
Block a user