Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8 Fix compatibility with ESPHome 2023.6 #4

Open
wants to merge 1 commit into
base: emerald_ble
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions esphome/components/emerald_ble/emerald_ble.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "emerald_ble.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/time.h"

#ifdef USE_ESP32

Expand Down Expand Up @@ -103,8 +104,8 @@ void Emerald::decode_emerald_packet_(const uint8_t *data, uint16_t length) {
// else, use the emerald measurement timestamps
#ifdef USE_TIME
auto *time_ = *this->time_;
time::ESPTime date_of_measurement = time_->now();
// time::ESPTime date_of_measurement = this->time_->now();
ESPTime date_of_measurement = time_->now();
// ESPTime date_of_measurement = this->time_->now();
if (date_of_measurement.is_valid()) {
if (this->day_of_last_measurement_ == 0) { this->day_of_last_measurement_ = date_of_measurement.day_of_year; }
else if (this->day_of_last_measurement_ != date_of_measurement.day_of_year) {
Expand Down