Documentation
¶
Overview ¶
Package api makes calls to the SunSynk API to read inverter statistics and to update settings.
Index ¶
- func BatteryDischargeThreshold(ctx context.Context) (int, error)
- func EssentialOnly(ctx context.Context) bool
- func InverterRatedPower(ctx context.Context) (int, error)
- func LowBatteryCapacity(ctx context.Context) (int, error)
- func Poll(ctx context.Context, configFile string, ch chan State)
- func ReadState(ctx context.Context, s *State) (bool, error)
- func UpdateBatteryCapacity(cap int) error
- func UpdateEssentialOnly(eo bool) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatteryDischargeThreshold ¶
BatteryDischargeThreshold returns the percentage SoC of the battery at which the inverter will use the grid rather than the battery to power the loads.
func EssentialOnly ¶
EssentialOnly returns true if the inverter should power only the essential circuits and returns false if the inverter should power all loads.
func InverterRatedPower ¶
InverterRatedPower returns the rated power of the inverter.
func LowBatteryCapacity ¶ added in v0.2.0
LowBatteryCapacity returns the SoC that generates a low battery capacity alarm.
func ReadState ¶
ReadState reads the current state of the inverter. The state must be passed as a pointer; the reference state will be updated if the SunSynk API returns fresh data. This function returns false if the state is unchanged.
func UpdateBatteryCapacity ¶
UpdateBatteryCapacity sets the battery's depth of discharge before the inverter will switch to grid power.
func UpdateEssentialOnly ¶
UpdateEssentialOnly sets whether the inverter should power all circuits (true) or should power all loads (false).