All the code changes to the chlorine pump... More will follow

This commit is contained in:
2024-05-12 23:02:52 +02:00
parent a96531dda9
commit 3d7e80154a
7 changed files with 489 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ CONF_AVERAGE_NEW = "on_completely_new_value"
UNIT_MILLI_VOLT = "mV"
ICON_LIGHTNING_BOLT="mdi:lightning-bolt"
ICON_TEST_TUBE="mdi:test-tube"
ChlorineValueRead = chlorine_sensor_ns.class_(
"ChlorineValueReadTrigger", automation.Trigger.template(cg.float_)
@@ -45,7 +45,7 @@ CONFIG_SCHEMA = cv.All(
accuracy_decimals=2,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
icon=ICON_LIGHTNING_BOLT
icon=ICON_TEST_TUBE
).extend({
cv.Required(CONF_SENSOR_PIN): adc.validate_adc_pin,
cv.Required(CONF_ZERO_POINT): cv.Range(min=0, max=1023),
@@ -88,12 +88,12 @@ async def to_code(config):
for conf in averager_config.get(CONF_ON_READ_VALUE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(float, "value")], conf)
await automation.build_automation(trigger, [(float, "x")], conf)
for conf in averager_config.get(CONF_AVERAGE_ON_VALUE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(float, "value")], conf)
await automation.build_automation(trigger, [(float, "x")], conf)
for conf in averager_config.get(CONF_AVERAGE_NEW, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(float, "value")], conf)
await automation.build_automation(trigger, [(float, "x")], conf)