Open glennpierce opened 7 years ago
Fixed this.
In the init function the username set line should be
self.username = username or ''
Actually the problem was also the / on the end of the url. The patch is
619c619
< self.username = username
---
> self.username = username or ''
647a648,650
>
> if address[-1] == '/':
> address = address[0:-1]
Hi I am using Sonoff-Tasmota with Philips hue bridge emulation and I am trying to get one to turn on / off.
I first had to change the get_api to
This is because username was None
get_api now simply returns
[{u'success': {u'username': u'e9da25'}}]
The json on my sonoff url http://192.168.1.74/api
is
{"lights":{"1":{"state":{"on":false,"bri":0,"hue":0,"sat":0,"effect":"none","ct":0,"alert":"none","colormode":"hs","reachable":true},"type":"Dimmable light","name":"Sonoff","modelid":"LWB004","manufacturername":"Philips","uniqueid":"5CCF7FE9DA25-1","swversion":"66012040"}},"groups":{},"schedules":{},"config":{"name":"Philips hue","mac":"5C:CF:7F:E9:DA:25","dhcp":true,"ipaddress":"192.168.1.74","netmask":"255.255.255.0","gateway":"192.168.1.254","proxyaddress":"","proxyport":0,"UTC":"2017-05-18T21:45:03","whitelist":{"":{"last use date":"2017-05-18T21:45:03","create date":"2017-05-18T21:45:03","name":"Remote"}},"swversion":"01036659","apiversion":"1.16.0","swupdate":{"updatestate":0,"url":"","text":"","notify": false},"linkbutton":false,"portalservices":false}}
The emulation works with my amazon echo so it is working.
Thanks