Skip to content

services: fix casting on toast#427

Draft
RuffaloLavoisier wants to merge 2 commits into
developfrom
fix/toast
Draft

services: fix casting on toast#427
RuffaloLavoisier wants to merge 2 commits into
developfrom
fix/toast

Conversation

@RuffaloLavoisier
Copy link
Copy Markdown
Member

fix time casting issue on toast feature.

@RuffaloLavoisier RuffaloLavoisier self-assigned this Jan 12, 2025
@RuffaloLavoisier RuffaloLavoisier linked an issue Jan 12, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Member

@simonmicro simonmicro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you fix this, you should fix all sections interacting with the incorrect time - even in this file are two. Also, did you rerun the unit-tests on your system? Maybe they catch that on MacOS and help you find those issues.

@simonmicro simonmicro force-pushed the feature/ble/basic-server branch from 55f1910 to 1590abd Compare January 12, 2025 11:37
auto currentTime = utcTimeInSeconds + std::chrono::seconds{static_cast<int>(OswHal::getInstance()->getTimezoneOffsetPrimary())};
auto currentDate = date::sys_days(floor<date::days>(currentTime));
auto scheduledTime = std::chrono::hours{hours} + std::chrono::minutes{minutes} + std::chrono::seconds{0};
auto timeToFire = currentDate + scheduledTime;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duration, right? Why did you not cast here?

auto currentTime = utcTimeInSeconds + std::chrono::seconds{static_cast<int>(OswHal::getInstance()->getTimezoneOffsetPrimary())};
if (auto it = scheduler.begin();
it != scheduler.end() && currentTime >= it->first) {
it != scheduler.end() && currentTime.count() >= it->first.time_since_epoch().count()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...same here?

Base automatically changed from feature/ble/basic-server to develop January 12, 2025 20:40
@RuffaloLavoisier RuffaloLavoisier marked this pull request as draft January 12, 2025 20:44
@simonmicro simonmicro force-pushed the develop branch 2 times, most recently from 890efcf to 9478a8e Compare January 14, 2025 11:20
@simonmicro simonmicro added this to the v0.18.1 milestone Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toast message service is not working

2 participants