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

AmbientLightSensor constructor cannot initialize illuminance #24

Closed
foolip opened this issue Apr 7, 2017 · 6 comments
Closed

AmbientLightSensor constructor cannot initialize illuminance #24

foolip opened this issue Apr 7, 2017 · 6 comments

Comments

@foolip
Copy link
Member

foolip commented Apr 7, 2017

https://w3c.github.io/ambient-light/#ambient-light-sensor-interface

This seems like a bug, there should probably be an AmbientLightSensorOptions dictionary that includes illuminance.

@pozdnyakov
Copy link

think the illuminance attribute should rather be nullable. @tobie

@foolip
Copy link
Member Author

foolip commented Apr 7, 2017

That would be an orthogonal question, the problem is that it's current readonly so there's no way to set it to any value.

@tobie
Copy link
Member

tobie commented Apr 7, 2017

Well, that's by design. It's a getter to the value provided by the sensor.

@pozdnyakov
Copy link

@foolip what would be the use case for setting illuminance from the ctor? AFAIK it should just contain the latest AML sensor reading in activated state and be null in all the other states.

@foolip
Copy link
Member Author

foolip commented Apr 7, 2017

OK, I didn't follow the links, I assumed that the relationship between AmbientLightSensor and Sensor was like that between MessageEvent and Event, that both had constructors that should be able to set all of the members, and that the members never change. Not so.

@foolip foolip closed this as completed Apr 7, 2017
@tobie
Copy link
Member

tobie commented Apr 7, 2017

That's the design we had initially, which probably explains why you got confused.

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

3 participants