divoom

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: BSD-2-Clause Imports: 12 Imported by: 0

README

Divoom Go package

example

Go package for Divoom Web API, such as Pixoo64.

Install:

go get github.com/suapapa/go_divoom

Reference

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidBrightness   = fmt.Errorf("brightness should be in range of 0~100")
	ErrInvalidWhiteBalance = fmt.Errorf("white balance should be in range of 0~100")
	ErrInvalidScore        = fmt.Errorf("score should be in range of 0~999")
	ErrInvalidPicNum       = fmt.Errorf("pic num should be smaller than 60")
	ErrInvalidPicWidth     = fmt.Errorf("pic width should be 16, 32 or 64")
	ErrNotImplemented      = fmt.Errorf("not implemented")
)

Functions

func DialType

func DialType() ([]string, error)

Types

type Channel

type Channel int
const (
	ChannelInvalid Channel = iota - 1
	ChannelFaces
	ChannelCloud
	ChannelVisualizer
	ChannelCustom
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(d *Device) *Client

func (*Client) ClearAllTextArea

func (c *Client) ClearAllTextArea() error

func (*Client) CloudChannel

func (c *Client) CloudChannel(idx CloudChannelIdx) error

func (*Client) CustomChannel

func (c *Client) CustomChannel(idx CustomIdx) error

func (*Client) GetAllSetting

func (c *Client) GetAllSetting() (map[string]interface{}, error)

func (*Client) GetCurrentChannel

func (c *Client) GetCurrentChannel() (Channel, error)

func (*Client) GetDeviceTime

func (c *Client) GetDeviceTime() (*DeviceTimeResult, error)

func (*Client) GetSelectFaceID

func (c *Client) GetSelectFaceID() (*FaceID, error)

func (*Client) GetSendingAnimationPicID

func (c *Client) GetSendingAnimationPicID() (int, error)

func (*Client) PlayGif

func (c *Client) PlayGif(t PlayGIFType, name string) error

func (*Client) ResetSendingAnimationPicID

func (c *Client) ResetSendingAnimationPicID() error

func (*Client) ScreenSwitch

func (c *Client) ScreenSwitch(on bool) error

func (*Client) SelectChannel

func (c *Client) SelectChannel(idx Channel) error

func (*Client) SelectFacesChannel

func (c *Client) SelectFacesChannel(id int) error

func (*Client) SendAnimation

func (c *Client) SendAnimation(width, id int, speedMSecs []int, picDatas [][]byte) error

func (*Client) SendAnimationGif added in v1.1.2

func (c *Client) SendAnimationGif(id int, gifImg *gif.GIF) error

func (*Client) SendAnimationImgs added in v1.1.1

func (c *Client) SendAnimationImgs(id int, speedMSecs []int, imgs []image.Image) error

func (*Client) SendDisplayList

func (c *Client) SendDisplayList() error

TODO: TBD

func (*Client) SendText

func (c *Client) SendText(id, x, y int, dir TextDir, font TextFont, width int, str string, speed int, color string, align TextAlign) error

func (*Client) SetBrightness

func (c *Client) SetBrightness(brightness int) error

func (*Client) SetCountdownTool

func (c *Client) SetCountdownTool(dur time.Duration, start bool) error

func (*Client) SetHighLightMode

func (c *Client) SetHighLightMode(on bool) error

func (*Client) SetHourMode

func (c *Client) SetHourMode(hm HourMode) error

func (*Client) SetMirrorMode

func (c *Client) SetMirrorMode(on MirrorMode) error

func (*Client) SetNoiseTool

func (c *Client) SetNoiseTool(on bool) error

func (*Client) SetRotationAngle

func (c *Client) SetRotationAngle(angle RotationAngle) error

func (*Client) SetScoreboardTool

func (c *Client) SetScoreboardTool(red, blue int) error

func (*Client) SetStopwatchTool

func (c *Client) SetStopwatchTool(s StopwatchStatus) error

func (*Client) SetTemperatureMode

func (c *Client) SetTemperatureMode(tempMode TempMode) error

func (*Client) SetTimeZone

func (c *Client) SetTimeZone(timezone string) error

func (*Client) SetWhiteBalance

func (c *Client) SetWhiteBalance(r, g, b int) error

func (*Client) SystemTime

func (c *Client) SystemTime(utcTime string) error

func (*Client) VisualizerChannel

func (c *Client) VisualizerChannel(idx int) error

func (*Client) WeatherAreaSetting

func (c *Client) WeatherAreaSetting(long, lat string) error

type CloudChannelIdx

type CloudChannelIdx int
const (
	CloudChannelRecommendGallery CloudChannelIdx = iota
	CloudChannelFavorite
	CloudChannelSubscribeArtist
)

type CustomIdx

type CustomIdx int
const (
	CustomIdx0 CustomIdx = iota
	CustomIdx1
	CustomIdx2
)

type Device

type Device struct {
	DeviceName      string `json:"DeviceName"`
	DeviceID        int    `json:"DeviceId"`
	DevicePrivateIP string `json:"DevicePrivateIP"`
}

func FindDevice

func FindDevice() ([]*Device, error)

type DeviceTimeResult

type DeviceTimeResult struct {
	ErrorCode int    `json:"error_code"`
	UTCTime   int    `json:"UTCTime"`
	LocalTime string `json:"LocalTime"`
}

type Dial

type Dial struct {
	ID   int    `json:"ClockId"`
	Name string `json:"Name"`
}

func DialList

func DialList(dialType string, page int) ([]Dial, int, error)

type FaceID

type FaceID struct {
	ClockID    int `json:"ClockId"`
	Brightness int `json:"Brightness"`
}

type Font

type Font struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Width   string `json:"width"`
	High    string `json:"high"`
	Charset string `json:"charset"`
	Type    int    `json:"type"`
}

func GetFontList

func GetFontList() ([]*Font, error)

type HourMode

type HourMode int
const (
	HourMode12 HourMode = iota
	HourMode24
)

type MirrorMode

type MirrorMode int
const (
	MirrorModeDisable MirrorMode = iota
	MirrorModeEnable
)

type PlayGIFType

type PlayGIFType int
const (
	PlayGIFTypeFile PlayGIFType = iota
	PlayGIFTypeFolder
	PlayGIFTypeNet
)

type RotationAngle

type RotationAngle int
const (
	RotationAngle0 RotationAngle = iota
	RotationAngle90
	RotationAngle180
	RotationAngle270
)

type StopwatchStatus

type StopwatchStatus int
const (
	StopwatchStatusStop StopwatchStatus = iota
	StopwatchStatusStart
	StopwatchStatusReset
)

type TempMode

type TempMode int
const (
	TempModeCelsius TempMode = iota
	TempModeFahrenheit
)

type TextAlign

type TextAlign int
const (
	TextAlignLeft TextAlign = iota + 1
	TextAlignMiddle
	TextAlighRight
)

type TextDir

type TextDir int
const (
	TextDirLeft TextDir = iota
	TextDirRight
)

type TextFont

type TextFont int
const (
	TextFont0 TextFont = iota
	TextFont1
	TextFont2
	TextFont3
	TextFont4
	TextFont5
	TextFont6
	TextFont7
)

Directories

Path Synopsis
_example

Jump to

Keyboard shortcuts

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