GithubHelp home page GithubHelp logo

nirantak / hue-api Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 222 KB

Async API for controlling Hue Lights

Home Page: https://hue-api.nirantak.com

License: MIT License

Makefile 5.88% Python 90.67% Shell 3.44%
hue api async hue-lights hue-bridge hue-api python

hue-api's Introduction

Hi, I am Nirantak ๐Ÿ‘‹๐Ÿผ

Engineer @ LinkedIn

Find me here

Website LinkedIn Twitter

I work with

Python Ruby NodeJS MySQL Docker Ansible Linux macOS Windows

I am learning

Go Kubernetes

hue-api's People

Contributors

dependabot[bot] avatar nirantak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hue-api's Issues

Add More Items to set_state()

Hi Nirantak,
Thanks so much for such a well written library and for keeping it up to date.

I was wondering if you had any plans to add the rest of the available states to the set_state() Light method?
Your library is amazing, but only supports a small number of state changes. I'd love to allow for effects, alert and colormode.

Is this something you'd be interested in adding? If not, can you tell me what the best way to go about it is? Is it as simple as adding the required keys in the method on line 101?

Many thanks again for all the time you put into this (and for the type hints).

set_state strange behaviour

Description

  • Hue API version: version = "0.4.8"
  • Python version: Python 3.11.6
  • Operating System: Arch linux

Thanks for this library !
I'm hooking my lights up to my StreamDeck +, and ran into this issue.

On initital get_state I end up with something like this ::

state = {"on": True, "bri": 228, "hue": 8378, "sat": 212, "effect": "none", "xy": [0.4976, 0.4266], "ct": 350, "alert": "select", "colormode": "hs", "mode": "homeautomation", "reachable": True}

I updated the "bri" value and set_state(state).
It set the full state as expected, but the light was kind of flashing and struggling with the info,
so I read a bit further and it looks like you can just update what you want as in , via asyncio: light.set_state({ "bri": 123 })

So I tried that, adn now the get_state call looks very different, even after a light.restore_state().

{"on": true, "bri": 213, "alert": "select", "mode": "homeautomation", "reachable": false

Everything else is gone.
Is that as expected?

Do I need to set a certain combination of parameters per mode?
I went through the developer docs and couldn't see anything on this.

Happy to send more data / run tests if it helps :)

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.