class Broadlink::Sp2

Included Modules

Defined in:

broadlink.cr

Constant Summary

ENERGY_PACKET = Bytes[8, 0, 254, 1, 5, 1, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0]

Constructors

Instance Method Summary

Instance methods inherited from module Broadlink

discover(timeout = 10, local_ip_address = "") discover, gendevice(devtype : UInt16, host : String, mac : Bytes) gendevice, setup(ssid : String, password : String, security_mode : UInt8) setup

Instance methods inherited from class Broadlink::Device

auth? auth?, decrypt(payload : Bytes) decrypt, devtype : UInt16 devtype, encrypt(payload : Bytes) encrypt, host : String host, mac : Slice(UInt8) mac, send_packet(command : UInt8, payload : Bytes) send_packet, type : String type

Constructor methods inherited from class Broadlink::Device

new(host : String, mac : Bytes, devtype : UInt16, timeout : Int32 = 1) new

Instance methods inherited from module Broadlink

discover(timeout = 10, local_ip_address = "") discover, gendevice(devtype : UInt16, host : String, mac : Bytes) gendevice, setup(ssid : String, password : String, security_mode : UInt8) setup

Constructor Detail

def self.new(host, mac, devtype) #

[View source]

Instance Method Detail

def energy #

[View source]
def nightlight=(state : Bool) #

Sets the night light state of the smart plug.


[View source]
def nightlight? #

Returns the power state of the smart plug.


[View source]
def power=(state : Bool) #

Sets the power state of the smart plug.


[View source]
def power? #

Returns the power state of the smart plug.


[View source]