Skip to content

Commit

Permalink
Change Command names
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Oct 14, 2024
1 parent fd6e4d1 commit d049a5c
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 28 deletions.
8 changes: 4 additions & 4 deletions components/tc_bus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
"floor_call": COMMAND_TYPE.COMMAND_TYPE_FLOOR_CALL,
"internal_call": COMMAND_TYPE.COMMAND_TYPE_INTERNAL_CALL,
"control_function": COMMAND_TYPE.COMMAND_TYPE_CONTROL_FUNCTION,
"start_talking_door_station": COMMAND_TYPE.COMMAND_TYPE_START_TALKING_DOOR_STATION,
"start_talking_ia": COMMAND_TYPE.COMMAND_TYPE_START_TALKING_IA,
"stop_talking_door_station": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING_DOOR_STATION,
"stop_talking_ia": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING_IA,
"start_talking_door_call": COMMAND_TYPE.COMMAND_TYPE_START_TALKING_DOOR_CALL,
"start_talking": COMMAND_TYPE.COMMAND_TYPE_START_TALKING,
"stop_talking_door_call": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING_DOOR_CALL,
"stop_talking": COMMAND_TYPE.COMMAND_TYPE_STOP_TALKING,
"open_door": COMMAND_TYPE.COMMAND_TYPE_OPEN_DOOR,
"light": COMMAND_TYPE.COMMAND_TYPE_LIGHT,
"door_opened": COMMAND_TYPE.COMMAND_TYPE_DOOR_OPENED,
Expand Down
30 changes: 15 additions & 15 deletions components/tc_bus/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ namespace esphome
command |= 0x41; // 41
break;

case COMMAND_TYPE_START_TALKING_IA:
case COMMAND_TYPE_START_TALKING_DOOR_CALL:
command |= (3 << 28); // 3
command |= ((serial_number & 0xFFFFF) << 8); // C30BA
command |= (1 << 7); // 8
command |= (address & 0xFF); // 0
break;

case COMMAND_TYPE_START_TALKING_DOOR_STATION:
case COMMAND_TYPE_START_TALKING:
command |= (3 << 28); // 3
command |= ((serial_number & 0xFFFFF) << 8); // C30BA
command &= ~(1 << 7); // 0
command |= (address & 0xFF); // 0
break;

case COMMAND_TYPE_STOP_TALKING_IA:
case COMMAND_TYPE_STOP_TALKING_DOOR_CALL:
command |= (3 << 12); // 3
command |= (1 << 7); // 08
command |= (address & 0xFF); // 0
break;

case COMMAND_TYPE_STOP_TALKING_DOOR_STATION:
case COMMAND_TYPE_STOP_TALKING:
command |= (3 << 12); // 3
command &= ~(1 << 7); // 00
command |= (address & 0xFF); // 0
Expand Down Expand Up @@ -185,11 +185,11 @@ namespace esphome
break;

case 3:
data.type = (command & (1 << 7)) ? COMMAND_TYPE_START_TALKING_IA : COMMAND_TYPE_START_TALKING_DOOR_STATION;
data.type = (command & (1 << 7)) ? COMMAND_TYPE_START_TALKING_DOOR_CALL : COMMAND_TYPE_START_TALKING;
data.address = command & 0xF;

// Door Readiness
if(data.type == COMMAND_TYPE_START_TALKING_DOOR_STATION)
if(data.type == COMMAND_TYPE_START_TALKING_DOOR_CALL)
{
data.payload = (command & (1 << 8)) != 0;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ namespace esphome
}
else if (first == 3)
{
data.type = (command & (1 << 7)) ? COMMAND_TYPE_STOP_TALKING_IA : COMMAND_TYPE_STOP_TALKING_DOOR_STATION;
data.type = (command & (1 << 7)) ? COMMAND_TYPE_STOP_TALKING_DOOR_CALL : COMMAND_TYPE_STOP_TALKING;
data.address = command & 0xF;
}
else if (first == 5)
Expand Down Expand Up @@ -387,10 +387,10 @@ namespace esphome
if (str == "FLOOR_CALL") return COMMAND_TYPE_FLOOR_CALL;
if (str == "INTERNAL_CALL") return COMMAND_TYPE_INTERNAL_CALL;
if (str == "CONTROL_FUNCTION") return COMMAND_TYPE_CONTROL_FUNCTION;
if (str == "START_TALKING_DOOR_STATION") return COMMAND_TYPE_START_TALKING_DOOR_STATION;
if (str == "START_TALKING_IA") return COMMAND_TYPE_START_TALKING_IA;
if (str == "STOP_TALKING_DOOR_STATION") return COMMAND_TYPE_STOP_TALKING_DOOR_STATION;
if (str == "STOP_TALKING_IA") return COMMAND_TYPE_STOP_TALKING_IA;
if (str == "START_TALKING_DOOR_CALL") return COMMAND_TYPE_START_TALKING_DOOR_CALL;
if (str == "START_TALKING") return COMMAND_TYPE_START_TALKING;
if (str == "STOP_TALKING_DOOR_CALL") return COMMAND_TYPE_STOP_TALKING_DOOR_CALL;
if (str == "STOP_TALKING") return COMMAND_TYPE_STOP_TALKING;
if (str == "OPEN_DOOR") return COMMAND_TYPE_OPEN_DOOR;
if (str == "LIGHT") return COMMAND_TYPE_LIGHT;
if (str == "DOOR_OPENED") return COMMAND_TYPE_DOOR_OPENED;
Expand Down Expand Up @@ -421,10 +421,10 @@ namespace esphome
case COMMAND_TYPE_FLOOR_CALL: return "FLOOR_CALL";
case COMMAND_TYPE_INTERNAL_CALL: return "INTERNAL_CALL";
case COMMAND_TYPE_CONTROL_FUNCTION: return "CONTROL_FUNCTION";
case COMMAND_TYPE_START_TALKING_DOOR_STATION: return "START_TALKING_DOOR_STATION";
case COMMAND_TYPE_START_TALKING_IA: return "START_TALKING_IA";
case COMMAND_TYPE_STOP_TALKING_DOOR_STATION: return "STOP_TALKING_DOOR_STATION";
case COMMAND_TYPE_STOP_TALKING_IA: return "STOP_TALKING_IA";
case COMMAND_TYPE_START_TALKING_DOOR_CALL: return "START_TALKING_DOOR_CALL";
case COMMAND_TYPE_START_TALKING: return "START_TALKING";
case COMMAND_TYPE_STOP_TALKING_DOOR_CALL: return "STOP_TALKING_DOOR_CALL";
case COMMAND_TYPE_STOP_TALKING: return "STOP_TALKING";
case COMMAND_TYPE_OPEN_DOOR: return "OPEN_DOOR";
case COMMAND_TYPE_LIGHT: return "LIGHT";
case COMMAND_TYPE_DOOR_OPENED: return "DOOR_OPENED";
Expand Down
8 changes: 4 additions & 4 deletions components/tc_bus/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ namespace esphome
COMMAND_TYPE_FLOOR_CALL,
COMMAND_TYPE_INTERNAL_CALL,
COMMAND_TYPE_CONTROL_FUNCTION,
COMMAND_TYPE_START_TALKING_DOOR_STATION,
COMMAND_TYPE_START_TALKING_IA,
COMMAND_TYPE_STOP_TALKING_DOOR_STATION,
COMMAND_TYPE_STOP_TALKING_IA,
COMMAND_TYPE_START_TALKING_DOOR_CALL,
COMMAND_TYPE_START_TALKING,
COMMAND_TYPE_STOP_TALKING_DOOR_CALL,
COMMAND_TYPE_STOP_TALKING,
COMMAND_TYPE_OPEN_DOOR,
COMMAND_TYPE_LIGHT,
COMMAND_TYPE_DOOR_OPENED,
Expand Down
4 changes: 4 additions & 0 deletions docs/de/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ Du musst den Modus nicht manuell aktivieren; er wird bei jedem Neustart automati
2. **Setup-Modus aktivieren:**\
Gehe zum Bereich `Konfiguration` und schalte den `Setup Mode` ein, um die interaktive Einrichtung zu beginnen.

::: warning Bevor du weitermachst
Deine Gegensprechanlage muss angeschlossen und das Gehäuse verschlossen sein, damit die Einrichtung abgeschlossen werden kann.
:::

3. **Einrichtung durchführen:**\
Die RGB-Status-LED wird grün-türkis pulsieren. Drücke den Klingeltaster vor der Wohnung oder am Eingang.

Expand Down
6 changes: 5 additions & 1 deletion docs/en/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Example:
>
> Starting with revision `1.5` this method will only produce a subtle, yet noticeable hissing sound on the speaker.
After connecting the `a` and `b` lines, you still need to connect `BUS PWR` using a jumper cap.
After connecting the `a` and `b` lines, you need to connect `BUS PWR` using a jumper cap.

Example:
![2-wire via intercom jumper](./images/2wire_intercom.png){width=300px}
Expand Down Expand Up @@ -83,6 +83,10 @@ You don't need to manually activate this mode; it will start automatically at ea
2. **Activate Setup Mode:**\
Go to the `Configuration` section and enable `Setup Mode` to begin the interactive setup.

::: warning Before you proceed
The intercom phone must be connected, and the enclosure securely closed, to complete the setup process.
:::

3. **Perform the Setup:**\
The RGB status LED will pulse green-turquoise. Press the doorbell button at your apartment or entrance.

Expand Down
34 changes: 30 additions & 4 deletions firmware/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,31 +377,57 @@ binary_sensor:
sorting_group_id: sorting_group_listeners
sorting_weight: -29

- platform: tc_bus
id: pick_up_phone_door_call
name: "Pick up phone (door call)"
icon: "mdi:phone-check"
type: start_talking_door_call
address: 255
auto_off: 0.2s
entity_category: DIAGNOSTIC
disabled_by_default: true
web_server:
sorting_group_id: sorting_group_listeners
sorting_weight: -19

- platform: tc_bus
id: hang_up_phone_door_call
name: "Hang up phone (door call)"
icon: "mdi:phone-remove"
type: stop_talking_door_call
address: 255
auto_off: 0.2s
entity_category: DIAGNOSTIC
disabled_by_default: true
web_server:
sorting_group_id: sorting_group_listeners
sorting_weight: -18

- platform: tc_bus
id: pick_up_phone
name: "Pick up phone"
icon: "mdi:phone-check"
type: start_talking_door_station
type: start_talking
address: 255
auto_off: 0.2s
entity_category: DIAGNOSTIC
disabled_by_default: true
web_server:
sorting_group_id: sorting_group_listeners
sorting_weight: -19
sorting_weight: -17

- platform: tc_bus
id: hang_up_phone
name: "Hang up phone"
icon: "mdi:phone-remove"
type: stop_talking_door_station
type: stop_talking
address: 255
auto_off: 0.2s
entity_category: DIAGNOSTIC
disabled_by_default: true
web_server:
sorting_group_id: sorting_group_listeners
sorting_weight: -18
sorting_weight: -16

- platform: tc_bus
id: function_button
Expand Down

0 comments on commit d049a5c

Please sign in to comment.