I had a bit of trouble with this and thought it worth sharing the solution.

With Python2 and pyownet I could use

    owp.write('/settings/timeout/directory', 60)

but with Python3 that throws an error, TypeError: 'data' argument must be binary.  I can use

    owp.write('/settings/timeout/directory', b'60')

but if I want to use a variable for the data the format which works is -

    x = 60
    owp.write('/settings/timeout/directory', bytes(str.encode(str(x))))

There may be other ways to do it but that works for me.

Mick



_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to