Add ADC Value to PIR Enabled Switches

- Add: ADC value reporting to PIR enabled switches, so that it may be used in polling automations.
- Add: ADC trigger state value reporting, for simpler automations.
- Add: Ability for features to use custom value parsers.
This commit is contained in:
Ryan Nitcher
2024-11-14 12:09:56 -07:00
parent cb89342be1
commit 84aa74546e
5 changed files with 232 additions and 21 deletions

View File

@@ -133,7 +133,7 @@ async def feature(
echo(f"{feat.name} ({name}): {feat.value}{unit}")
return feat.value
value = ast.literal_eval(value)
value = feat.parse_value(value, ast.literal_eval)
echo(f"Changing {name} from {feat.value} to {value}")
response = await dev.features[name].set_value(value)
await dev.update()