Skip to content

Commit

Permalink
Add Ringtone select
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Sep 23, 2024
1 parent 8c9b57d commit cab789c
Showing 1 changed file with 42 additions and 8 deletions.
50 changes: 42 additions & 8 deletions firmware/addons/memory-utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ number:
max_value: 7
step: 1
set_action:
then:
- tc_bus.update_setting:
type: volume_ringtone
value: !lambda "return x;"
- tc_bus.update_setting:
type: volume_ringtone
value: !lambda "return x;"

- platform: template
name: "Handset volume"
Expand All @@ -31,10 +30,45 @@ number:
max_value: 7
step: 1
set_action:
then:
- tc_bus.update_setting:
type: volume_handset
value: !lambda "return x;"
- tc_bus.update_setting:
type: volume_handset
value: !lambda "return x;"

select:
- platform: template
name: "Ringtone: Door Call"
optimistic: true
options:
- "Ringtone 1"
- "Ringtone 2"
- "Ringtone 3"
- "Ringtone 4"
- "Ringtone 5"
- "Ringtone 6"
- "Ringtone 7"
- "Ringtone 8"
- "Ringtone 9"
- "Ringtone 10"
- "Ringtone 11"
- "Ringtone 12"
initial_option: "Ringtone 1"
set_action:
- tc_bus.update_setting:
type: ringtone_door_call
value: !lambda |-
std::string str = x;
std::vector<std::string> v;
char * token;
char seps[] = " ";
token = strtok (&str[1],seps);
while (token != NULL)
{
v.push_back(token);
token = strtok (NULL, seps);
}
return std::stoi(v[1].c_str());
button:
- platform: template
Expand Down

0 comments on commit cab789c

Please sign in to comment.