Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add light.alpha() method #20

Open
durera opened this issue Apr 2, 2019 · 2 comments
Open

Add light.alpha() method #20

durera opened this issue Apr 2, 2019 · 2 comments

Comments

@durera
Copy link

durera commented Apr 2, 2019

I can use the various accessor methods for all properties, except alpha. For alpha I need to to use raw_values tuple, would be nice to add aplha() to the Light class to avoid need to handle raw_values(), e.g. to avoid something like this:

			# Alpha is only available from raw_values()
			(onoff, lum, temp, red, green, blue, alpha) = light.raw_values()

			# if online is false then override on to be false, the light can't be on if it's not even powered on 
			state = {
				"online": light.reachable(),
				"lastSeen": light.last_seen(),
				"on": (light.reachable() and light.on()),
				"lum": light.lum(),
				"temp": light.temp(),
				"colour": {
					"red": light.red(),
					"green": light.green(),
					"blue": light.blue()
				},
				"alpha": alpha
			}
@OleksandrBerchenko
Copy link

No problem, I will add the alpha method.

Well, the main question is: how do you use that value? :) From my experience, it never changes (that's why it's not exposed). Could you please explain your case?

Thanks!

@OleksandrBerchenko
Copy link

@durera So, is that property actual for all device types or just for some particular ones? Do I need to preserve int or to convert it to bool?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants