Back to Nodemcu Firmware

Yeelink Module

docs/lua-modules/yeelink.md

latest1.3 KB
Original Source

Yeelink Module

SinceOrigin / ContributorMaintainerSource
2015-04-14Martin HanMartin Hanyeelink_lib.lua

This Lua module provides a simple implementation of an Yeelink client.

Require

lua
yeelink = require("yeelink_lib")

Release

lua
yeelink = nil
package.loaded["yeelink_lib"] = nil

Initializes Yeelink client.

Syntax

yeelink.init(device, sensor, apikey)

Parameters

  • device: device number
  • sensor: sensor number
  • apikey: Yeelink API key string

Returns

IP address of api.yeelink.net, if not obtained then false

Function to check DNS resolution of api.yeelink.net status.

Syntax

yeelink.getDNS()

Parameters

None

Returns

IP address of api.yeelink.net or nil when name resolution failed.

Send data to Yeelink Sever.

Syntax

yeelink.update(datapoint)

Parameters

  • datapoint: Data to send to Yeelink API

Returns

nil

Notes

Example of using this module can be found in Example_for_Yeelink_Lib.lua file.