HASensor improvements (#222)

* added support for setting None value in the HASensor

* added support for the expire_after property in the HASensor

* update readme and docs

* added expire_after property in the HABinarySensor

* increase default device types limit to 24 on non ATMega328/168 processors

* added support for the JSON attributes in the HASensor
This commit is contained in:
Dawid Chyrzyński
2024-02-06 17:01:46 +01:00
committed by GitHub
parent ae059aecc1
commit 87b7e03fe6
25 changed files with 434 additions and 44 deletions
+1
View File
@@ -15,6 +15,7 @@ HACover cover("myCover", HACover::PositionFeature);
// PositionFeature is optional, however required to be in a "stopped" state other than open or closed.
// If ommitted, a CommandStop will result in HA treating the cover as either Open or Closed immediately after the command.
// See https://www.home-assistant.io/integrations/cover.mqtt/
// Added in https://github.com/dawidchyrzynski/arduino-home-assistant/pull/111
void onCoverCommand(HACover::CoverCommand cmd, HACover* sender) {
if (cmd == HACover::CommandOpen) {
+3
View File
@@ -44,5 +44,8 @@ void loop() {
analogSensor.setValue(voltage);
lastUpdateAt = millis();
// you can reset the sensor as follows:
// analogSensor.setValue(nullptr);
}
}
@@ -37,5 +37,8 @@ void loop() {
unsigned long uptimeValue = millis() / 1000;
uptimeSensor.setValue(uptimeValue);
lastUpdateAt = millis();
// you can reset the sensor as follows:
// analogSensor.setValue(nullptr);
}
}