Skip to content

Commit

Permalink
on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Apr 22, 2024
1 parent 04d647d commit db0dbd8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/User/UserModHA.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ class UserModHA:public SysModule {
static void onStateCommand(bool state, HALight* sender) {
ppf("State: %s\n", state?"true":"false");

if(state) {
mdl->setValue("bri", 255);
}
else {
mdl->setValue("bri", 0);
}
mdl->setValue("on", state);

sender->setState(state); // report state back to the Home Assistant
}
Expand All @@ -61,7 +56,7 @@ class UserModHA:public SysModule {
}

void connectedChanged() {
ppf("connectedChanged");
ppf("connectedChanged\n");
if (mdls->isConnected) {
// set device's details (optional)
device.setName(_INIT(TOSTRING(APP)));
Expand Down

0 comments on commit db0dbd8

Please sign in to comment.