Documentation ¶
Index ¶
- Variables
- func ImageToRGB24Bytes(img image.Image) []byte
- type Client
- func (c *Client) ClearAllTextArea() error
- func (c *Client) GetSendingAnimationPicID() (int, error)
- func (c *Client) ResetSendingAnimationPicId() error
- func (c *Client) SendAnimation(animationId int, numPictures int, pictureIndex int, width int, speed int, ...) error
- func (c *Client) SendDisplayList(elements ...DisplayListElement) error
- func (c *Client) SendText(id, x, y int, dir TextScrollDirection, font TextFont, width int, str string, ...) error
- func (c *Client) SetBrightness(brightness int) error
- func (c *Client) SetMirrorMode(mirrorMode MirrorMode) error
- func (c *Client) SetRotation(deviceIp string, rotation RotationAngle) error
- type Device
- type DisplayListElement
- type MirrorMode
- type RotationAngle
- type TextAlignment
- type TextFont
- type TextScrollDirection
- type TextType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidBrightness = fmt.Errorf("brightness should be in range of 0-100")
)
Functions ¶
func ImageToRGB24Bytes ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientFromDevice ¶
func (*Client) ClearAllTextArea ¶
func (*Client) GetSendingAnimationPicID ¶
func (*Client) ResetSendingAnimationPicId ¶
func (*Client) SendAnimation ¶
func (*Client) SendDisplayList ¶
func (c *Client) SendDisplayList(elements ...DisplayListElement) error
func (*Client) SendText ¶
func (c *Client) SendText(id, x, y int, dir TextScrollDirection, font TextFont, width int, str string, speed int, color string, align TextAlignment) error
func (*Client) SetBrightness ¶
func (*Client) SetMirrorMode ¶
func (c *Client) SetMirrorMode(mirrorMode MirrorMode) error
func (*Client) SetRotation ¶
func (c *Client) SetRotation(deviceIp string, rotation RotationAngle) error
type Device ¶
type Device struct { DeviceName string `json:"DeviceName"` DeviceID int `json:"DeviceId"` DevicePrivateIP string `json:"DevicePrivateIP"` DeviceMAC string `json:"DeviceMac"` }
func FindDevices ¶
type DisplayListElement ¶
type DisplayListElement struct { Id int `json:"TextId"` TextType TextType `json:"type"` X int `json:"x"` Y int `json:"y"` ScrollDirection TextScrollDirection `json:"dir"` Font int `json:"font"` Width int `json:"TextWidth"` Height int `json:"Textheight"` Text string `json:"TextString"` Speed int `json:"speed"` Color string `json:"color"` UpdateTime int `json:"update_time"` TextAlignment TextAlignment `json:"align"` }
type MirrorMode ¶
type MirrorMode int
const ( MirrorModeDisable MirrorMode = 0 MirrorModeEnable MirrorMode = 1 )
type RotationAngle ¶
type RotationAngle int
const ( RotationNormal RotationAngle = 0 Rotation90 RotationAngle = 1 Rotation180 RotationAngle = 2 Rotation270 RotationAngle = 3 )
type TextAlignment ¶
type TextAlignment int
const ( TextAlignmentLeft TextAlignment = 1 TextAlignmentMiddle TextAlignment = 2 TextAlignmentRight TextAlignment = 3 )
type TextScrollDirection ¶
type TextScrollDirection int
const ( TextScrollDirectionLeft TextScrollDirection = 0 TextScrollDirectionRight TextScrollDirection = 1 )
type TextType ¶
type TextType int
const ( TextTypeTimeSecond TextType = 1 TextTypeTimeMinute TextType = 2 TextTypeTimeHour TextType = 3 TextTypeTimeAmPm TextType = 4 TextTypeTimeHourMinute TextType = 5 // hour:min TextTypeTimeHourMinuteSecond TextType = 6 // hour:min:sec TextTypeDateYear TextType = 7 TextTypeDateDay TextType = 8 TextTypeDateMonth TextType = 9 TextTypeDateMonthYear TextType = 10 // month-year TextTypeDateMonthNameDotDay TextType = 11 // month-name.day TextTypeDateWeekYear TextType = 12 // day:month:year ??? TextTypeDateDayName2Char TextType = 13 // weekday-"SU","MO","TU","WE","TH","FR","SA" TextTypeDateDayName3Char TextType = 14 // weekday-"SUN","MON","TUE","WED","THU","FRI","SAT" TextTypeDateDayNameFull TextType = 15 // weekday-"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY" TextTypeDateMonthName3Char TextType = 16 // month-"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC" TextTypeWeatherTemp TextType = 17 // temperature + c/f TextTypeWeatherTodayMaxTemp TextType = 18 TextTypeWeatherTodayMinTemp TextType = 19 TextTypeWeatherName TextType = 20 // the weather TextTypeNoise TextType = 21 // the noise value TextTypeText TextType = 22 // a defined text TextTypeNetText TextType = 23 // an url that responds with a json including the "DispData" string element, eg:http://appin.divoom-gz.com/Device/ReturnCurrentDate?test=0 reponse {"DispData": "2022-01-22 13:51:56"} )
Click to show internal directories.
Click to hide internal directories.