Skip to content

Commit

Permalink
Add fix for hrAndMinutePoints dial
Browse files Browse the repository at this point in the history
- Fix a bug in the Hour and Minute points Dial. More infos here: #2 (comment)
  • Loading branch information
Nerdiyde committed Feb 13, 2021
1 parent 86fa27c commit 42e9987
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions plugin/ESPEasy/_P205_pxlBlck.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,6 @@ boolean Plugin_205(byte function, struct EventStruct *event, String& string)

void Plugin_205_update()
{
//checkTime(); //updating systemtime-variables first --> removed to adapt to release "ESPEasy-mega-20201130"
uint8_t hours = node_time.hour();
uint8_t minutes = node_time.minute();
int seconds = node_time.second();
Expand Down Expand Up @@ -3401,14 +3400,21 @@ void Plugin_205_write_prepared_pixels_to_display(uint8_t pixelsToShow[][PLUGIN_2
void Plugin_205_show_dial_hourNumberAndMinutePoints(uint8_t hours, uint8_t minutes, uint32_t hourColorAm, uint32_t hourColorPm, uint32_t minuteColor, uint32_t bgColor, boolean leadingZerosEnabled, boolean twentyFourHrModeEnabled)
{
uint32_t hrColor = hourColorAm;

//limit hours to 12hr format if 24hr mode is deactivated and set hour color accordingly
//switch color to pm color after 12 if 12 hr mode is activated
if (!twentyFourHrModeEnabled && hours > 11)
{
hours = hours - 12;
hrColor = hourColorPm;
}

//limit hours to 12hr format if 24hr mode is deactivated and set hour color accordingly
if (!twentyFourHrModeEnabled && hours > 12)
{
hours = hours - 12;
} else if (!twentyFourHrModeEnabled && hours==0) //to handle the conversion from 00:00 to 12 pm
{
hours = 12;
}

pxlBlckUtils_fill_matrix(bgColor);

//the following part should set the pixels within in a specific area
Expand Down
Binary file modified plugin/bin/ESP32_ESPEasy_incl_pxlBlck_4M_2M_SPIFFS_NO_OTA.bin
Binary file not shown.
Binary file modified plugin/bin/ESP8266_ESPEasy_incl_pxlBlck_4M.bin
Binary file not shown.

0 comments on commit 42e9987

Please sign in to comment.