ESPHome  2024.2.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::sun::Sun Class Reference

#include <sun.h>

Public Member Functions

void set_time (time::RealTimeClock *time)
 
time::RealTimeClockget_time () const
 
void set_latitude (double latitude)
 
void set_longitude (double longitude)
 
optional< ESPTimesunrise (double elevation)
 
optional< ESPTimesunset (double elevation)
 
optional< ESPTimesunrise (ESPTime date, double elevation)
 
optional< ESPTimesunset (ESPTime date, double elevation)
 
double elevation ()
 
double azimuth ()
 

Protected Member Functions

internal::HorizontalCoordinate calc_coords_ ()
 
optional< ESPTimecalc_event_ (bool rising, double zenith)
 
optional< ESPTimecalc_event_ (ESPTime date, bool rising, double zenith)
 

Protected Attributes

time::RealTimeClocktime_
 
internal::GeoLocation location_
 

Detailed Description

Definition at line 55 of file sun.h.

Member Function Documentation

◆ azimuth()

double esphome::sun::Sun::azimuth ( )

Definition at line 319 of file sun.cpp.

◆ calc_coords_()

HorizontalCoordinate esphome::sun::Sun::calc_coords_ ( )
protected

Definition at line 277 of file sun.cpp.

◆ calc_event_() [1/2]

optional< ESPTime > esphome::sun::Sun::calc_event_ ( bool  rising,
double  zenith 
)
protected

Definition at line 309 of file sun.cpp.

◆ calc_event_() [2/2]

optional< ESPTime > esphome::sun::Sun::calc_event_ ( ESPTime  date,
bool  rising,
double  zenith 
)
protected

Definition at line 290 of file sun.cpp.

◆ elevation()

double esphome::sun::Sun::elevation ( )

Definition at line 318 of file sun.cpp.

◆ get_time()

time::RealTimeClock* esphome::sun::Sun::get_time ( ) const
inline

Definition at line 58 of file sun.h.

◆ set_latitude()

void esphome::sun::Sun::set_latitude ( double  latitude)
inline

Definition at line 59 of file sun.h.

◆ set_longitude()

void esphome::sun::Sun::set_longitude ( double  longitude)
inline

Definition at line 60 of file sun.h.

◆ set_time()

void esphome::sun::Sun::set_time ( time::RealTimeClock time)
inline

Definition at line 57 of file sun.h.

◆ sunrise() [1/2]

optional< ESPTime > esphome::sun::Sun::sunrise ( double  elevation)

Definition at line 314 of file sun.cpp.

◆ sunrise() [2/2]

optional< ESPTime > esphome::sun::Sun::sunrise ( ESPTime  date,
double  elevation 
)

Definition at line 316 of file sun.cpp.

◆ sunset() [1/2]

optional< ESPTime > esphome::sun::Sun::sunset ( double  elevation)

Definition at line 315 of file sun.cpp.

◆ sunset() [2/2]

optional< ESPTime > esphome::sun::Sun::sunset ( ESPTime  date,
double  elevation 
)

Definition at line 317 of file sun.cpp.

Field Documentation

◆ location_

internal::GeoLocation esphome::sun::Sun::location_
protected

Definition at line 76 of file sun.h.

◆ time_

time::RealTimeClock* esphome::sun::Sun::time_
protected

Definition at line 75 of file sun.h.


The documentation for this class was generated from the following files: