Skip to content

Commit bdad371

Browse files
authored
Merge pull request #66 from lubeda/2023.7.1
2023.7.1
2 parents 6d065e3 + 2563bad commit bdad371

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- develop
7+
- 2023.7.1
88
- main
99
pull_request:
1010

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2023.7.1
4+
5+
- reinroduced set_clock_color
6+
37
## 2023.7.0
48

59
- added always_show_rl_indicators boolean

components/ehmtxv2/EHMTX.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace esphome
1616
this->text_color = Color(C_RED, C_GREEN, C_BLUE);
1717
this->today_color = Color(C_RED, C_GREEN, C_BLUE);
1818
this->weekday_color = Color(CD_RED, CD_GREEN, CD_BLUE);
19+
this->clock_color = Color(C_RED, C_GREEN, C_BLUE);
1920
this->rainbow_color = Color(CA_RED, CA_GREEN, CA_BLUE);
2021
this->alarm_color = Color(CA_RED, CA_GREEN, CA_BLUE);
2122
this->next_action_time = 0;
@@ -323,6 +324,7 @@ namespace esphome
323324

324325
register_service(&EHMTX::set_today_color, "set_today_color", {"r", "g", "b"});
325326
register_service(&EHMTX::set_weekday_color, "set_weekday_color", {"r", "g", "b"});
327+
register_service(&EHMTX::set_clock_color, "set_clock_color", {"r", "g", "b"});
326328

327329
register_service(&EHMTX::del_screen, "del_screen", {"icon_name", "mode"});
328330
register_service(&EHMTX::force_screen, "force_screen", {"icon_name", "mode"});
@@ -389,6 +391,13 @@ namespace esphome
389391
ESP_LOGD(TAG, "hide alarm");
390392
}
391393

394+
void EHMTX::set_clock_color(int r, int g, int b)
395+
{
396+
this->clock_color = Color((uint8_t)r & 248, (uint8_t)g & 252, (uint8_t)b & 248);
397+
ESP_LOGD(TAG, "default clock color r: %d g: %d b: %d", r, g, b);
398+
}
399+
400+
392401
void EHMTX::blank_screen(int lifetime, int showtime)
393402
{
394403
auto scr = this->find_free_queue_element();
@@ -614,7 +623,7 @@ namespace esphome
614623
{
615624
#ifndef EHMTXv2_ALLOW_EMPTY_SCREEN
616625
ESP_LOGW(TAG, "tick: nothing to do. Restarting clock display!");
617-
this->clock_screen(24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE);
626+
this->clock_screen(24 * 60, this->clock_time, false, this->clock_color[0], this->clock_color[1], this->clock_color[2]);
618627
this->date_screen(24 * 60, (int)this->clock_time / 2, false, C_RED, C_GREEN, C_BLUE);
619628
this->next_action_time = ts + this->clock_time;
620629
#endif

components/ehmtxv2/EHMTX.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const uint8_t TEXTSCROLLSTART = 8;
2525
const uint8_t TEXTSTARTOFFSET = (32 - 8);
2626

2727
const uint16_t POLLINGINTERVAL = 250;
28-
static const char *const EHMTX_VERSION = "2023.7.0";
28+
static const char *const EHMTX_VERSION = "2023.7.1";
2929
static const char *const TAG = "EHMTXv2";
3030

3131
enum show_mode : uint8_t
@@ -81,15 +81,15 @@ namespace esphome
8181
uint16_t hue_ = 0;
8282
void dump_config();
8383
#ifdef USE_ESP32
84-
PROGMEM Color text_color, alarm_color, rindicator_color, lindicator_color, today_color, weekday_color, rainbow_color;
84+
PROGMEM Color text_color, alarm_color, rindicator_color, lindicator_color, today_color, weekday_color, rainbow_color, clock_color;
8585
PROGMEM Color bitmap[256];
8686
PROGMEM Color sbitmap[64];
8787
PROGMEM Color cgauge[8];
8888
PROGMEM EHMTX_Icon *icons[MAXICONS];
8989
#endif
9090

9191
#ifdef USE_ESP8266
92-
Color text_color, alarm_color, gauge_color, gauge_bgcolor,rindicator_color,lindicator_color, today_color, weekday_color, rainbow_color;
92+
Color text_color, alarm_color, gauge_color, gauge_bgcolor,rindicator_color,lindicator_color, today_color, weekday_color, rainbow_color, clock_color;
9393
EHMTX_Icon *icons[MAXICONS];
9494
uint8_t gauge_value;
9595
#endif
@@ -152,6 +152,7 @@ namespace esphome
152152
void show_lindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3);
153153
void set_today_color(int r, int g, int b);
154154
void set_weekday_color(int r, int g, int b);
155+
void set_clock_color(int r = C_RED, int g = C_GREEN, int b = C_BLUE);
155156
void show_alarm(int r = CA_RED, int g = CA_GREEN, int b = CA_BLUE, int s = 2);
156157
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
157158
void hide_gauge();

components/ehmtxv2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
SVG_END = "</svg>"
2929

3030
logging.warning(f"")
31-
logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2")
3231
logging.warning(f"This will only work with esphome >= 2023.7.0")
32+
logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2")
3333
logging.warning(f"")
3434

3535
def rgb565_svg(x,y,r,g,b):

0 commit comments

Comments
 (0)