Skip to content

Commit

Permalink
Add functionality to change timer value
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
olicooper committed May 2, 2024
1 parent f49e84c commit 8285a7e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/nspanel_lovelace/nspanel_lovelace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,15 @@ void NSPanelLovelace::process_button_press_(
} else if (starts_with(button_type, entity_type::timer)) {
std::string service(button_type);
service[5] = '.';
this->call_ha_service_(service, entity_id);
if (value.empty()) {
this->call_ha_service_(service, entity_id);
} else {
this->call_ha_service_(service,
{{
{to_string(ha_attr_type::entity_id), entity_id},
{to_string(ha_attr_type::duration), value.c_str()}
}}, {});
}
}
}

Expand Down

0 comments on commit 8285a7e

Please sign in to comment.