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

Get all schedules should return the full schedules resource #22

Open
maiersoft opened this issue Dec 4, 2015 · 4 comments
Open

Get all schedules should return the full schedules resource #22

maiersoft opened this issue Dec 4, 2015 · 4 comments

Comments

@maiersoft
Copy link

Hi Stevey,
as of bridge version 1.3 the full schedules resource is returned from the bridge.
Currently the Emulator just returns the name of the schedule.
It would be great if the Emulator could be updated to reflect this.

Thanks,
Joe

@SteveyO
Copy link
Owner

SteveyO commented Dec 4, 2015

Hi Joe,

I have just committed HueEmulator-v0.7.jar. Give this a try if you want. In this version I now return the full groups resource (introduced in API 1.4), and I am returning a near full Schedules Resource.

Note however, that Schedules was never fully implemented in the Emulator and has some fields missing (e.g. autodelete, status, starttime, created), so am not sure how valuable this change is without the full schedules implementation. To be honest its a while since I implemented the schedules in the Emulator and can't remember exactly in what state it is, so would be great if you let me know if it works.

Steve

@SteveyO SteveyO closed this as completed Dec 4, 2015
@maiersoft
Copy link
Author

Hi Steve,

Thanks for updating.
There are indeed some hickups in the schedule handling.
From what i tested i found that when creating a schedule the Emulator returns an error.
E.g. With this payload:

{
"name": "Nach Mitternacht",
"description": "My Midnight lights",
"command": {
"address": "/api/a3b6ef5b20810491a1997b25606362b/groups/0/action",
"method": "PUT",
"body": {
"scene": "Mitternacht"
}
},
"localtime": "2015-12-05T00:05:00",
"status": "enabled"
}

It get this response with a „Socket closed by peer“ error, so the response is not complete:

HTTP/1.1 200 OK
Transfer-encoding: chunked
Cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Access-control-allow-credentials: true
Content-type: application/json; charset=utf-8
Expires: Mon, 1 Aug 2011 09:00:00 GMT
Connection: close
Access-control-allow-headers: Content-Type
Pragma: no-cache
Access-control-allow-origin: *
Date: Fri, 04 Dec 2015 16:07:20 GMT
Access-control-allow-methods: POST, GET, OPTIONS, PUT, DELETE
Access-control-max-age: 0

The „Get all Schedules" command afterwards provides:

{„1":{"description":"My Midnight lights","name":"Nach Mitternacht","command":{"body":{"bri":0,"on":false},"address":"/api/a3b6ef5b20810491a1997b25606362b/groups/0/action","method":"PUT"}}}

So the schedule’s command property isn’t saved as provided in the payload.
Also the localtime and status properties are missing.

That’s what i found after s short test of 0.7

Thanks and cheers from Germany,
Joe

Von: Steve <[email protected]mailto:[email protected]>
Antworten an: SteveyO/Hue-Emulator <[email protected]mailto:[email protected]>
Datum: Freitag, 4. Dezember 2015 um 16:44
An: SteveyO/Hue-Emulator <[email protected]mailto:[email protected]>
Cc: Joachim Maier <[email protected]mailto:[email protected]>
Betreff: Re: [Hue-Emulator] Get all schedules should return the full schedules resource (#22)

Hi Joe,

I have just committed HueEmulator-v0.7.jar. Give this a try if you want. In this version I now return the full groups resource (introduced in API 1.4), and I am returning a near full Schedules Resource.

Note however, that Schedules was never fully implemented in the Emulator and has some fields missing (e.g. autodelete, status, starttime, created), so am not sure how valuable this change is without the full schedules implementation. To be honest its a while since I implemented the schedules in the Emulator and can't remember exactly in what state it is, so would be great if you let me know if it works.

Steve


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-162000050.

@SteveyO
Copy link
Owner

SteveyO commented Dec 7, 2015

Hi Joe,
I have a lot of work issues to deal with this week, so hopefully towards the end of the week I can take a look at this in a bit more detail. I will let you know. Thanks for providing the extra information though, this will be helpful.
Thanks
Steve

@maiersoft
Copy link
Author

Hi Steve,

No problem. The Emulator has been and still is very helpful.
Thanks anyway for providing it for the community.

Looking forward to any updates. Let me know when i can help testing.

Cheers,
Joe

— ————————————————
maiersoft internet & mobile solutions
Joachim Maier
Reiherweg 9
71336 Waiblingen
www.maiersoft.de
[email protected]

Von: Steve <[email protected]mailto:[email protected]>
Antworten an: SteveyO/Hue-Emulator <[email protected]mailto:[email protected]>
Datum: Montag, 7. Dezember 2015 um 14:14
An: SteveyO/Hue-Emulator <[email protected]mailto:[email protected]>
Cc: Joachim Maier <[email protected]mailto:[email protected]>
Betreff: Re: [Hue-Emulator] Get all schedules should return the full schedules resource (#22)

Hi Joe,
I have a lot of work issues to deal with this week, so hopefully towards the end of the week I can take a look at this in a bit more detail. I will let you know. Thanks for providing the extra information though, this will be helpful.
Thanks
Steve


Reply to this email directly or view it on GitHubhttps://github.com//issues/22#issuecomment-162520806.

@SteveyO SteveyO reopened this Dec 17, 2015
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