mirror of
https://github.com/alexhopeoconnor/arduino-home-assistant.git
synced 2026-10-04 02:48:13 +10:00
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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user