Code Monkey home page Code Monkey logo

Comments (6)

natcl avatar natcl commented on September 17, 2024 1

Perhaps your API key isn't valid anymore. Try deleting the .python_hue file and doing the registration/button push again

from phue.

cchaz003 avatar cchaz003 commented on September 17, 2024

I think I've figured it out. I'm not totally sure what happened to make it stop working but giving the bridge a username as part of the bridge init (which in phue.py says is optional, and is not used in examples). In the past whenever there was an update I would just get an error telling me to push the button and then it would work, this time I actually had to put in the username. Did some API change or is this just my computers being weird?

from phue.

natcl avatar natcl commented on September 17, 2024

It's probably because your api key got deleted in the bridge after the update.
you should be getting an error message however.... I'll look into it.
Does it work now without providing a username ?

lecaude.com
studioimaginaire.com

Le 2014-07-12 à 03:18, Charlie [email protected] a écrit :

I think I've figured it out. I'm not totally sure what happened to make it stop working but giving the bridge a username as part of the bridge init (which in phue.py says is optional, and is not used in examples). In the past whenever there was an update I would just get an error telling me to push the button and then it would work, this time I actually had to put in the username. Did some API change or is this just my computers being weird?


Reply to this email directly or view it on GitHub.

from phue.

cchaz003 avatar cchaz003 commented on September 17, 2024

I actually changed the bridge init method because I didnt want to go though and change all my scripts.

# def __init__(self, ip=None, username=None):
    def __init__(self, ip=None, username="newdeveloper"):

when I change back to username=None, I get the error above. I remember throwing in some prints to debug what might be the problem (wish I had logged them!) and remember seeing somewhere that it was trying to interact with the bridge using some seemingly random username (along the lines of /api/asd6sdf6876sdf/...). I dont know if this helps at all but it would explain the error above since it a random username would be invalid. I actually figured out it was a username issue originally by printing the light object from the error above (before crashing) and got this output:

{u'error': {u'type': 1, u'description': u'unauthorized user', u'address': u'/lights'}}

I dont know if that helps at all... I'm not much of a python developer, I mostly work with AVR micros so this is mostly just me fumbling around.

from phue.

alexfromapex avatar alexfromapex commented on September 17, 2024

Having this same issue, after not running my script for a long time

debug info:

>>> b.get_api()
[{u'error': {u'type': 1, u'description': u'unauthorized user', u'address': u'/'}}]

from phue.

alexfromapex avatar alexfromapex commented on September 17, 2024

That worked, thanks! I just had to push the button again too. Otherwise, I got this error:

Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> b = phue.Bridge('192.168.1.76') File "C:\Python27\lib\site-packages\phue.py", line 427, in __init__ self.connect() File "C:\Python27\lib\site-packages\phue.py", line 551, in connect self.register_app() File "C:\Python27\lib\site-packages\phue.py", line 519, in register_app 'The link button has not been pressed in the last 30 seconds.') PhueRegistrationException

from phue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.