Versions in this module Expand all Collapse all v0 v0.3.2 Mar 10, 2025 v0.3.1 Feb 28, 2025 v0.3.0 Jan 3, 2025 v0.2.0 Jul 16, 2024 Changes in this version type API + GetDeviceInfo func(ctx context.Context) (DeviceInfoResponse, error) + GetP1Telegram func(ctx context.Context) (P1TelegramResponse, error) type Client + func (api *Client) GetDeviceInfo(ctx context.Context) (DeviceInfoResponse, error) + func (api *Client) GetP1Telegram(ctx context.Context) (P1TelegramResponse, error) + type DeviceInfoResponse struct + Firmware string + MAC string + Model string + type P1TelegramResponse struct + Data []byte type PhaseReading + func (r PhaseReading) InUse() bool v0.1.2 Jul 5, 2024 Changes in this version + const TimestampLayout + func ParseTimestamp(ts uint64) (time.Time, error) + func ToTimestamp(t time.Time) uint64 v0.1.1 Jun 19, 2024 v0.1.0 Jun 18, 2024 Changes in this version + const AttrDeviceFirmware + const AttrDeviceMAC + const AttrDeviceModel + const DateTimeLayout + const ErrApplyOption + const ErrInvalidBaseURL + const ErrInvalidConfig + const ErrInvalidPassword + const ErrPasswordRequired + const ErrReadPasswordFile + const LogTimeLayout + const TracerName + type API interface + GetDevice func(ctx context.Context) (DeviceResponse, error) + GetLog func(ctx context.Context, u Utility, i Interval, page uint) (LogResponse, error) + GetMeterReading func(ctx context.Context) (MeterReadingResponse, error) + GetPhaseReading func(ctx context.Context) (PhaseReadingResponse, error) + type APIRequester interface + func NewAPIRequester(r Requester) APIRequester + type Client struct + Config Config + func NewClient(conf Config, opts ...Option) (*Client, error) + func (api *Client) GetDevice(ctx context.Context) (DeviceResponse, error) + func (api *Client) GetLog(ctx context.Context, u Utility, i Interval, page uint) (LogResponse, error) + func (api *Client) GetMeterReading(ctx context.Context) (MeterReadingResponse, error) + func (api *Client) GetPhaseReading(ctx context.Context) (PhaseReadingResponse, error) + func (c *Client) AuthCookie(ctx context.Context) (*http.Cookie, error) + func (c *Client) Authorize(ctx context.Context, password string) (_ http.Cookie, err error) + func (c *Client) Request(ctx context.Context, page string, out any) (err error) + func (c *Client) With(opts ...Option) error + type Config struct + BaseURL string + Name string + Password string + PasswordFile string + Timeout time.Duration + func (c Config) Validate() error + type DeviceResponse struct + Firmware string + MAC string + Model string + type ElectricityReading struct + ElectricityExport1 float64 + ElectricityExport2 float64 + ElectricityImport1 float64 + ElectricityImport2 float64 + NetElectricity float64 + Power int64 + Timestamp int64 + func (r ElectricityReading) Time() time.Time + type GasReading struct + GasTimestamp uint64 + GasTotal float64 + func (r GasReading) Time() time.Time + type Interval uint32 + const Per10min + const PerDay + const PerHour + const PerMin + func (i Interval) Delta() uint32 + func (i Interval) Duration() time.Duration + func (i Interval) Param() rune + func (i Interval) String() string + type LogResponse struct + Interval Interval + RawValues []string + Timestamp string + Unit Unit + func (r LogResponse) Time() time.Time + func (r LogResponse) TimeOfValue(i uint) time.Time + func (r LogResponse) TimedValues() ([]TimedValue, error) + type Logger interface + LogClientRequest func(ctx context.Context, clientName, url string, shared bool) + LogFetchAuthCookie func(clientName string, cookie http.Cookie) + func DefaultLogger() Logger + func NewLogger(l *log.Logger) Logger + func NopLogger() Logger + type MeterReadingResponse struct + type Option func(c *Client) error + func WithDefaultLogger() Option + func WithDefaultTracerProvider() Option + func WithHTTPClient(client http.Client) Option + func WithLogger(l Logger) Option + func WithTracer(t trace.Tracer) Option + func WithTracerProvider(tp trace.TracerProvider) Option + type PhaseReading struct + Current float64 + Power int64 + Voltage float64 + type PhaseReadingResponse struct + Current1 float64 + Current2 float64 + Current3 float64 + Power1 int64 + Power2 int64 + Power3 int64 + Tariff uint8 + Voltage1 float64 + Voltage2 float64 + Voltage3 float64 + func (r PhaseReadingResponse) Phase1() PhaseReading + func (r PhaseReadingResponse) Phase2() PhaseReading + func (r PhaseReadingResponse) Phase3() PhaseReading + type Requester interface + Request func(ctx context.Context, path string, out any) error + type S0Reading struct + S0 int64 + S0Timestamp int64 + S0Total float64 + func (r S0Reading) Time() time.Time + type TimedValue struct + Inactive bool + Time time.Time + Value int64 + func (tv TimedValue) String() string + type UnexpectedResponseError struct + StatusCode int + func (e *UnexpectedResponseError) Error() string + type Unit string + const CubicMeter + const ErrInvalidLogPage + const KWh + const Liter + const Watt + func (u Unit) String() string + type UnsupportedIntervalError struct + Interval Interval + Utility Utility + func (e UnsupportedIntervalError) Error() string + type Utility string + const Electricity + const Gas + const S0 + const Water + func (s Utility) Endpoint() string + func (s Utility) String() string + type WaterReading struct + WaterTimestamp uint64 + WaterTotal float64 + func (r WaterReading) Time() time.Time