Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Oct 10, 2024
1 parent ba22f27 commit c4fc15e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions components/tc_bus/protocol.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "protocol.h"
#include "esphome.h"
#include "esphome/core/helpers.h"
#include <algorithm>
#include <cctype>

namespace esphome
{
Expand Down Expand Up @@ -343,13 +345,17 @@ namespace esphome

const Model string_to_model(std::string str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);

if (str == "ISH_3030") return MODEL_ISH_3030;

return MODEL_NONE;
}

const SettingType string_to_setting_type(std::string str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);

if (str == "RINGTONE_FLOOR_CALL") return SETTING_RINGTONE_FLOOR_CALL;
if (str == "RINGTONE_DOOR_CALL") return SETTING_RINGTONE_DOOR_CALL;
if (str == "RINGTONE_INTERNAL_CALL") return SETTING_RINGTONE_INTERNAL_CALL;
Expand All @@ -361,6 +367,8 @@ namespace esphome

const CommandType string_to_command_type(std::string str)
{
std::transform(str.begin(), str.end(), str.begin(), ::toupper);

if (str == "DOOR_CALL") return COMMAND_TYPE_DOOR_CALL;
if (str == "FLOOR_CALL") return COMMAND_TYPE_FLOOR_CALL;
if (str == "INTERNAL_CALL") return COMMAND_TYPE_INTERNAL_CALL;
Expand Down Expand Up @@ -419,7 +427,6 @@ namespace esphome
case COMMAND_TYPE_READ_MEMORY_BLOCK: return "READ_MEMORY_BLOCK";
case COMMAND_TYPE_SELECT_MEMORY_PAGE: return "SELECT_MEMORY_PAGE";
case COMMAND_TYPE_WRITE_MEMORY: return "WRITE_MEMORY";
case COMMAND_TYPE_UNKNOWN: return "UNKNOWN";
default: return "UNKNOWN";
}
}
Expand All @@ -433,7 +440,6 @@ namespace esphome
case SETTING_RINGTONE_INTERNAL_CALL: return "RINGTONE_INTERNAL_CALL";
case SETTING_VOLUME_RINGTONE: return "VOLUME_RINGTONE";
case SETTING_VOLUME_HANDSET: return "VOLUME_HANDSET";
case SETTING_UNKNOWN: return "UNKNOWN";
default: return "UNKNOWN";
}
}
Expand All @@ -443,7 +449,6 @@ namespace esphome
switch (model)
{
case MODEL_ISH_3030: return "ISH_3030";
case MODEL_NONE: return "NONE";
default: return "NONE";
}
}
Expand Down
2 changes: 1 addition & 1 deletion firmware/addons/ring-to-open.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ select:

- platform: template
id: doorman_ring_to_open_door_trigger
name: "Ring To Open: Triggering Door Staion"
name: "Ring To Open: Triggering Door Station"
icon: mdi:door
optimistic: true
options:
Expand Down

0 comments on commit c4fc15e

Please sign in to comment.