Fixes
This commit is contained in:
@@ -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