Closed MrJoy closed 8 years ago
Hi Jon,
Firstly thanks for the code changes/pull requests. There is quite a lot of stuff there so I will review it when I have a bit more time.
I wasn't planning on adding Lux or other Friends of Hue products/bulbs. Mostly due to not having the Graphics Resources. However, Lux shouldn't be too difficult, so I may add another menu option to add a Lux bulb (in the next version).
You mention the Emulator returns a notably different state JSON to the actual bridge? I just checked the lights JSON in emulator and Hue bridge and they look the same to me. Can you give me an example? The JSON in the emulator is up to around the Bridge API 1.3.0 (so no luminaire stuff). Lux has different JSON as you say, but as the Emulator doesn't support Lux bulbs then there are no emulator differences here.
Steve
Edit - I have just noticed the JSON for bulbs that were added manually via the Add New Bulb Menu is different. Never noticed this before, it is a bug, so will fix for next version.
Ah, if it's only up to 1.3.0 that explains quite a bit. My bridges are all on the very latest firmware version. The long and short of it is that return extra fields that cause the JSON mapper you're using to choke -- and do so without providing any feedback at all about why.
Ideally it would ignore unrecognized fields, and provide sane defaults for missing fields. Failing that if there's a way to get it to produce meaningful error messages it would make things somewhat easier.
Hi Jon,
I have just committed a new version. In this version you can create Hue Lux Bulbs (new menu item), I have fixed the issue I mentioned above (with missing JSON for bulbs manually added from the menus) and I merged in your pull request. As you are running from Source then feel free to Pull in the new version and check. I will build the new 0.6 .jar file in a few days once am happy all is working.
Am not 100% sure what you mean with the extra fields causing the JSON mapper to choke or unrecognized fields. Could you elaborate? The error messages that the Emulator returns should match the error messages that a hue bridge returns, if you see otherwise please let me know. As far as I can see most of the Emulator error messages are correct. For example, if you try and set a hue or xy value on a Lux Bulb the emulator should throw the same JSON error as a Hue bridge.
I mean from the JSON config file, not the API requests.
So if you feed it a config snapshot from a bridge running 1.8, that includes a bunch of new fields that Jackson chokes on. No message from Jackson about where in the source it choked, or what the key it choked on was. I'm mid-way through a pass to add ignore markers for all the new things but may not get to that until after my wedding.
Aggh Ok, this is clear now. To be honest I have not done this (taken a bridge snapshot and used it in the emulator). Usually for different configs I would just take the existing one and copy/paste the Lights that I would need, and manually increase the Light Identifiers, and manually changing the color values. Obviously if you have a large set-up this approach is a little tedious.
If you are a member of the Hue Developers community the changelog should document all the new fields since API 1.3. http://www.developers.meethue.com/documentation/changelog.
I am not planning on introducing any of the 1.3+ new JSON fields due to the complexity. We have Rules, Sensors, MultiSource Luminaire stuff for example that would be too complex to manage in the Emulator.
Fortunately for me, I'm not using any of those things at the moment. And yeah, getting the semantics right around rules/sensors seems like an exercise in pain. Although the Luminaire stuff might be worth doing since it should mostly boil down to "here's a new type of group, no you don't get to modify/delete it."
-JF
On Oct 6, 2015, at 9:31 AM, Steve notifications@github.com wrote:
Aggh Ok, this is clear now. To be honest I have not done this (taken a bridge snapshot and used it in the emulator). Usually for different configs I would just take the existing one and copy/paste the Lights that I would need, and manually increase the Light Identifiers, and manually changing the color values. Obviously if you have a large set-up this approach is a little tedious.
If you are a member of the Hue Developers community the changelog should document all the new fields since API 1.3. http://www.developers.meethue.com/documentation/changelog http://www.developers.meethue.com/documentation/changelog.
I am not planning on introducing any of the 1.3+ new JSON fields due to the complexity. We have Rules, Sensors, MultiSource Luminaire stuff for example that would be too complex to manage in the Emulator.
— Reply to this email directly or view it on GitHub https://github.com/SteveyO/Hue-Emulator/issues/16#issuecomment-145920247.
Fortunately for me, I'm not using any of those things at the moment. And yeah, getting the semantics right around rules/sensors seems like an exercise in pain. Although the Luminaire stuff might be worth doing since it should mostly boil down to "here's a new type of group, no you don't get to modify/delete it."
On Oct 6, 2015, at 9:31 AM, Steve <notifications@github.com mailto:notifications@github.com> wrote:
Aggh Ok, this is clear now. To be honest I have not done this (taken a bridge snapshot and used it in the emulator). Usually for different configs I would just take the existing one and copy/paste the Lights that I would need, and manually increase the Light Identifiers, and manually changing the color values. Obviously if you have a large set-up this approach is a little tedious.
If you are a member of the Hue Developers community the changelog should document all the new fields since API 1.3. http://www.developers.meethue.com/documentation/changelog http://www.developers.meethue.com/documentation/changelog.
I am not planning on introducing any of the 1.3+ new JSON fields due to the complexity. We have Rules, Sensors, MultiSource Luminaire stuff for example that would be too complex to manage in the Emulator.
— Reply to this email directly or view it on GitHub https://github.com/SteveyO/Hue-Emulator/issues/16#issuecomment-145920247.
I have just committed version 0.6 with the ability to Add Hue Lux bulbs. A bit later than expected sorry, this is a very part time project.
The Hue Bridge returns a state document that is notably different from the one the emulator supports, making it hard to snapshot a config state and use it in emulation.
One example of this -- although it has knock-on effects in terms of API behavior -- is that the Lux bulbs don't have color-related fields (and the hub throws errors if you try to muck with color on them).
Would be nice if the emulator had support for the current native JSON structure, and Lux semantics...