41 num_t right_ascension_rad()
const;
42 num_t declination_rad()
const;
49 num_t elevation_rad()
const;
50 num_t azimuth_rad()
const;
63 bool is_above_horizon(
double elevation = -0.83333) {
return this->elevation() > elevation; }
90 double current = this->parent_->elevation();
91 if (std::isnan(current))
96 crossed = this->last_elevation_ <= this->elevation_ && this->elevation_ < current;
98 crossed = this->last_elevation_ >= this->elevation_ && this->elevation_ > current;
101 if (crossed && !std::isnan(this->last_elevation_)) {
104 this->last_elevation_ = current;
109 double last_elevation_{NAN};
115 TEMPLATABLE_VALUE(
double, elevation);
119 double elevation = this->elevation_.value(
x...);
120 double current = this->parent_->elevation();
122 return current > elevation;
124 return current < elevation;
internal::GeoLocation location_
The RealTimeClock class exposes common timekeeping functions via the device's local real-time clock...
void set_sunrise(bool sunrise)
A more user-friendly version of struct tm from time.h.
void set_longitude(double longitude)
This class simplifies creating components that periodically check a state.
time::RealTimeClock * get_time() const
void set_time(time::RealTimeClock *time)
Base class for all automation conditions.
void set_elevation(double elevation)
bool is_above_horizon(double elevation=-0.83333)
void set_above(bool above)
bool check(Ts... x) override
Implementation of SPI Controller mode.
time::RealTimeClock * time_
num_t longitude_rad() const
num_t latitude_rad() const
Helper class to easily give an object a parent of type T.
void set_latitude(double latitude)