Skip to content

Commit

Permalink
Internal Errror (#68)
Browse files Browse the repository at this point in the history
* Add internal error detection

* removed trailing space

* Apply formatting

---------

Co-authored-by: Bart Kock <[email protected]>
Co-authored-by: Till <[email protected]>
  • Loading branch information
3 people authored Jun 8, 2024
1 parent e710147 commit 78563fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.esphome/
.vscode/
.vs/
/tests/.gitignore
/secrets.yaml
*/__pycache__/
Expand Down
3 changes: 3 additions & 0 deletions components/philips_coffee_machine/localization.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace esphome
const std::string state_water_empty = "Wasser leer";
const std::string state_waste_warning = "Abfallcontainerwarnung";
const std::string state_error = "Fehler";
const std::string state_internal_error = "Interner Fehler";

const std::string state_ground_coffee_selected = "Vorgemahlener Kaffee ausgewählt";
const std::string state_coffee_programming_mode = "Kaffee Programmiermodus ausgewählt";
Expand Down Expand Up @@ -64,6 +65,7 @@ namespace esphome
const std::string state_water_empty = "Serbatoio Acqua Vuoto";
const std::string state_waste_warning = "Attenzione Contenitore Fondi Caffè";
const std::string state_error = "Errore";
const std::string state_internal_error = "Errore interno";

const std::string state_ground_coffee_selected = "Selezionato Caffè Premacinato";
const std::string state_coffee_programming_mode = "Selezionata Modalità programmazione Caffè";
Expand Down Expand Up @@ -115,6 +117,7 @@ namespace esphome
const std::string state_water_empty = "Water empty";
const std::string state_waste_warning = "Waste container warning";
const std::string state_error = "Error";
const std::string state_internal_error = "Internal Error";

const std::string state_ground_coffee_selected = "Pre-ground Coffee selected";
const std::string state_coffee_programming_mode = "Coffee programming mode selected";
Expand Down
21 changes: 14 additions & 7 deletions components/philips_coffee_machine/text_sensor/status_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ namespace esphome
return;
}

// 3 warning lights indicate an internal error (i.e. overheating)
if (data[15] != led_off && data[14] == led_second)
{
update_state(state_internal_error);
return;
}

// Warning/Error led
if (data[15] == led_second)
{
update_state(state_error);
return;
}

// Water empty led
if (data[14] == led_second)
{
Expand All @@ -81,13 +95,6 @@ namespace esphome
return;
}

// Warning/Error led
if (data[15] == led_second)
{
update_state(state_error);
return;
}

// Coffee selected
if (data[3] == led_off && data[4] == led_off && (data[5] == led_on || data[5] == led_second) && data[6] == led_off)
{
Expand Down

0 comments on commit 78563fb

Please sign in to comment.