Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 442 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 442 Bytes

MicroPython relay module for Sonoff Dual

Simple module for original Sonoff Dual

Functions

SonoffDual.setOn(relay) # relay: 0 or 1

SonoffDual.setOff(relay) # relay: 0 or 1

SonoffDual.getStatus() # return a list, e.g. ['on', 'off']

Example

from sonoffdual import SonoffDual

relay = SonoffDual()

relay.setOn(0)
relay.setOn(1)
print(relay.getStatus())
relay.setOff(0)
relay.setOff(1)
print(relay.getStatus()[0])