Skip to content

Commit

Permalink
Merge pull request #66 from lubeda/2023.7.1
Browse files Browse the repository at this point in the history
2023.7.1
  • Loading branch information
lubeda authored Jul 24, 2023
2 parents 6d065e3 + 2563bad commit bdad371
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- develop
- 2023.7.1
- main
pull_request:

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2023.7.1

- reinroduced set_clock_color

## 2023.7.0

- added always_show_rl_indicators boolean
Expand Down
11 changes: 10 additions & 1 deletion components/ehmtxv2/EHMTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace esphome
this->text_color = Color(C_RED, C_GREEN, C_BLUE);
this->today_color = Color(C_RED, C_GREEN, C_BLUE);
this->weekday_color = Color(CD_RED, CD_GREEN, CD_BLUE);
this->clock_color = Color(C_RED, C_GREEN, C_BLUE);
this->rainbow_color = Color(CA_RED, CA_GREEN, CA_BLUE);
this->alarm_color = Color(CA_RED, CA_GREEN, CA_BLUE);
this->next_action_time = 0;
Expand Down Expand Up @@ -323,6 +324,7 @@ namespace esphome

register_service(&EHMTX::set_today_color, "set_today_color", {"r", "g", "b"});
register_service(&EHMTX::set_weekday_color, "set_weekday_color", {"r", "g", "b"});
register_service(&EHMTX::set_clock_color, "set_clock_color", {"r", "g", "b"});

register_service(&EHMTX::del_screen, "del_screen", {"icon_name", "mode"});
register_service(&EHMTX::force_screen, "force_screen", {"icon_name", "mode"});
Expand Down Expand Up @@ -389,6 +391,13 @@ namespace esphome
ESP_LOGD(TAG, "hide alarm");
}

void EHMTX::set_clock_color(int r, int g, int b)
{
this->clock_color = Color((uint8_t)r & 248, (uint8_t)g & 252, (uint8_t)b & 248);
ESP_LOGD(TAG, "default clock color r: %d g: %d b: %d", r, g, b);
}


void EHMTX::blank_screen(int lifetime, int showtime)
{
auto scr = this->find_free_queue_element();
Expand Down Expand Up @@ -614,7 +623,7 @@ namespace esphome
{
#ifndef EHMTXv2_ALLOW_EMPTY_SCREEN
ESP_LOGW(TAG, "tick: nothing to do. Restarting clock display!");
this->clock_screen(24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE);
this->clock_screen(24 * 60, this->clock_time, false, this->clock_color[0], this->clock_color[1], this->clock_color[2]);
this->date_screen(24 * 60, (int)this->clock_time / 2, false, C_RED, C_GREEN, C_BLUE);
this->next_action_time = ts + this->clock_time;
#endif
Expand Down
7 changes: 4 additions & 3 deletions components/ehmtxv2/EHMTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const uint8_t TEXTSCROLLSTART = 8;
const uint8_t TEXTSTARTOFFSET = (32 - 8);

const uint16_t POLLINGINTERVAL = 250;
static const char *const EHMTX_VERSION = "2023.7.0";
static const char *const EHMTX_VERSION = "2023.7.1";
static const char *const TAG = "EHMTXv2";

enum show_mode : uint8_t
Expand Down Expand Up @@ -81,15 +81,15 @@ namespace esphome
uint16_t hue_ = 0;
void dump_config();
#ifdef USE_ESP32
PROGMEM Color text_color, alarm_color, rindicator_color, lindicator_color, today_color, weekday_color, rainbow_color;
PROGMEM Color text_color, alarm_color, rindicator_color, lindicator_color, today_color, weekday_color, rainbow_color, clock_color;
PROGMEM Color bitmap[256];
PROGMEM Color sbitmap[64];
PROGMEM Color cgauge[8];
PROGMEM EHMTX_Icon *icons[MAXICONS];
#endif

#ifdef USE_ESP8266
Color text_color, alarm_color, gauge_color, gauge_bgcolor,rindicator_color,lindicator_color, today_color, weekday_color, rainbow_color;
Color text_color, alarm_color, gauge_color, gauge_bgcolor,rindicator_color,lindicator_color, today_color, weekday_color, rainbow_color, clock_color;
EHMTX_Icon *icons[MAXICONS];
uint8_t gauge_value;
#endif
Expand Down Expand Up @@ -152,6 +152,7 @@ namespace esphome
void show_lindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3);
void set_today_color(int r, int g, int b);
void set_weekday_color(int r, int g, int b);
void set_clock_color(int r = C_RED, int g = C_GREEN, int b = C_BLUE);
void show_alarm(int r = CA_RED, int g = CA_GREEN, int b = CA_BLUE, int s = 2);
void show_gauge(int v, int r = C_RED, int g = C_GREEN, int b = C_BLUE,int bgr = CG_GREY, int bgg = CG_GREY, int bgb = CG_GREY); // int because of register_service
void hide_gauge();
Expand Down
2 changes: 1 addition & 1 deletion components/ehmtxv2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
SVG_END = "</svg>"

logging.warning(f"")
logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2")
logging.warning(f"This will only work with esphome >= 2023.7.0")
logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2")
logging.warning(f"")

def rgb565_svg(x,y,r,g,b):
Expand Down

0 comments on commit bdad371

Please sign in to comment.