fixed input publish and change climate to name

This commit is contained in:
Siwat Sirichai 2024-01-01 00:07:11 +07:00
parent 4c77474a94
commit e1f0fd5651
6 changed files with 55 additions and 14 deletions

View file

@ -57,7 +57,7 @@ uint8_t DigitalInputIoT::getType() {
void DigitalInputIoT::publishDigitalInput(uint8_t pin) {
char topic[20] = {0};
char payload[20] = {0};
topic[0] = pin-pin%10 + '0';
topic[0] = pin/10 + '0';
topic[1] = pin%10 + '0';
topic[2] = '\0';
payload[0] = this->card->digitalRead(pin, false) + '0';