Documentation ¶
Overview ¶
Package fhome provides functionality to interact with smart home devices connected to F&Home system.
Index ¶
- Constants
- Variables
- func MapToValue(v int) string
- type Action
- type Cell
- type Client
- func (c *Client) Close() error
- func (c *Client) GetMyResources() (*GetMyResourcesResponse, error)
- func (c *Client) GetUserConfig() (*File, error)
- func (c *Client) OpenClientSession(email, password string) error
- func (c *Client) OpenClientToResourceSession(resourcePassword string) error
- func (c *Client) XEvent(resourceID int, value string) error
- type File
- type GetMyResources
- type GetMyResourcesResponse
- type MobileDisplayCell
- type OpenClientSession
- type OpenClientToResourceSession
- type Panel
- type PositionInPanel
- type Response
- type Server
- type TouchesResponse
- type XEvent
Constants ¶
View Source
const ( ActionOpenClientSession = "open_client_session" ActionGetMyData = "get_my_data" ActionGetMyResources = "get_my_resources" ActionOpenClienToResourceSession = "open_client_to_resource_session" ActionTouches = "touches" ActionGetUserConfig = "get_user_config" ActionXEvent = "xevent" )
Variables ¶
View Source
var ( ValueToggle = "0x4001" Value0 = "0x6000" Value20 = "0x6014" Value40 = "0x6028" Value60 = "0x603C" Value80 = "0x6050" Value100 = "0x6064" )
Functions ¶
func MapToValue ¶
Types ¶
type Cell ¶
type Cell struct { ObjectID int `json:"objectId"` Icon string `json:"icon"` Name string `json:"name"` PositionInPanel []PositionInPanel `json:"positionInPanel"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetMyResources ¶
func (c *Client) GetMyResources() (*GetMyResourcesResponse, error)
GetMyResources gets resources assigned to the user.
Most of the time, there will be just one resource. Currently we handle only this case and assign its unique ID on the client.
func (*Client) GetUserConfig ¶
func (*Client) OpenClientSession ¶
func (*Client) OpenClientToResourceSession ¶
OpenClientToResourceSession connects to the user's resource.
Currently, it assumes that a user has only one resource.
type GetMyResources ¶
type GetMyResourcesResponse ¶
type GetMyResourcesResponse struct { ActionName string `json:"action_name"` RequestToken string `json:"request_token"` Status string `json:"status"` Source string `json:"source"` AvatarID0 string `json:"avatar_id_0"` FriendlyName0 string `json:"friendly_name_0"` ResourceType0 string `json:"resource_type_0"` UniqueID0 string `json:"unique_id_0"` }
type MobileDisplayCell ¶
type MobileDisplayCell struct { // Cell description Cd string `json:"CD"` // Object ID Oi string `json:"OI"` // Type number. Known values: 706, 707, 708, 709, 710, 711, 717, 718, 719, // 722, 724, 760 Tn string `json:"TN"` // Preset. Known values: 0, 1, 4 P string `json:"P"` // Style Se string `json:"Se"` Min string `json:"Min"` Max string `json:"Max"` // Step (aka current value). Sp string `json:"Sp"` // Display Type. Known values: BIT, BYTE, TEMP (Temperature), PROC // (Percentage), RGB (Light) Dt string `json:"DT"` // Cell permission. Known values: FC (Full Control), RO (Read Only) Cp string `json:"CP"` }
MobileDisplayCell is a Cell, but returned from "touches" action.
type OpenClientSession ¶
type PositionInPanel ¶
type PositionInPanel struct { Orientation string `json:"orientation"` PanelID string `json:"panelId"` X int `json:"x"` Y int `json:"y"` }
func (PositionInPanel) String ¶
func (p PositionInPanel) String() string
type Response ¶
type Response struct { ActionName string `json:"action_name"` RequestToken string `json:"request_token"` Status string `json:"status"` Source string `json:"source"` // Non-nil for "disconnecting" action Details string `json:"details"` Reason string `json:"reason"` // Non-nil for ActionGetUserConfig File string `json:"file"` }
type TouchesResponse ¶
type TouchesResponse struct { ActionName string `json:"action_name"` Response struct { ProjectVersion string `json:"ProjectVersion"` Status bool `json:"Status"` StatusText string `json:"StatusText"` MobileDisplayProperties struct { Cells []MobileDisplayCell `json:"Cells"` } `json:"MobileDisplayProperties"` } `json:"response"` Status string `json:"status"` Source string `json:"source"` RequestToken string `json:"request_token"` }
Click to show internal directories.
Click to hide internal directories.