tibber

package
v0.0.0-...-175a4df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URI             = "https://api.tibber.com/v1-beta/gql"
	SubscriptionURI = "wss://api.tibber.com/v1-beta/gql/subscriptions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Address1, PostalCode, City, Country string
}

type Client

type Client struct {
	*graphql.Client
}

func NewClient

func NewClient(log *util.Logger, token string) *Client

func (*Client) DefaultHome

func (c *Client) DefaultHome(id string) (Home, error)

func (*Client) Homes

func (c *Client) Homes() ([]Home, error)

type Home

type Home struct {
	ID                string
	TimeZone          string
	Address           Address
	MeteringPointData struct {
		GridCompany string
	}
	CurrentSubscription Subscription
}

type LiveMeasurement

type LiveMeasurement struct {
	// Timestamp                       time.Time
	Power                           float64
	PowerProduction                 float64
	LastMeterConsumption            float64
	LastMeterProduction             float64
	CurrentL1, CurrentL2, CurrentL3 float64
}

type Price

type Price struct {
	Currency    string
	StartsAt    time.Time
	Total       float64
	Energy, Tax float64
}

type PriceInfo

type PriceInfo struct {
	Current         Price
	Today, Tomorrow []Price
}

type Subscription

type Subscription struct {
	ID        string
	Status    string
	PriceInfo PriceInfo
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL