Skip to content

Commit ba4eac0

Browse files
committed
Update (timestamps and sun sample)
1 parent 2c5bc0c commit ba4eac0

File tree

1 file changed

+29
-30
lines changed

1 file changed

+29
-30
lines changed

source/developers/rest_api.markdown

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ Returns an array of state changes in the past. Each object contains further deta
196196
"unit_of_measurement": "\u00b0C"
197197
},
198198
"entity_id": "sensor.weather_temperature",
199-
"last_changed": "23:30:00 05-02-2016",
200-
"last_updated": "23:30:00 05-02-2016",
199+
"last_changed": "2016-02-06T22:15:00+00:00",
200+
"last_updated": "2016-02-06T22:15:00+00:00"",
201201
"state": "-3.9"
202202
},
203203
{
@@ -206,8 +206,8 @@ Returns an array of state changes in the past. Each object contains further deta
206206
"unit_of_measurement": "\u00b0C"
207207
},
208208
"entity_id": "sensor.weather_temperature",
209-
"last_changed": "07:03:30 06-02-2016",
210-
"last_updated": "07:03:30 06-02-2016",
209+
"last_changed": "2016-02-06T22:15:00+00:00"",
210+
"last_updated": "2016-02-06T22:15:00+00:00"",
211211
"state": "-1.9"
212212
},
213213
]
@@ -230,18 +230,15 @@ Returns an array of state objects. Each state has the following attributes: enti
230230
```json
231231
[
232232
{
233-
"attributes": {
234-
"next_rising": "07:04:15 29-10-2013",
235-
"next_setting": "18:00:31 29-10-2013"
236-
},
233+
"attributes": {},
237234
"entity_id": "sun.sun",
238-
"last_changed": "23:24:33 28-10-2013",
235+
"last_changed": "2016-05-30T21:43:32.418320+00:00",
239236
"state": "below_horizon"
240237
},
241238
{
242239
"attributes": {},
243240
"entity_id": "process.Dropbox",
244-
"last_changed": "23:24:33 28-10-2013",
241+
"last_changed": "22016-05-30T21:43:32.418320+00:00",
245242
"state": "on"
246243
}
247244
]
@@ -258,13 +255,17 @@ Returns a state object for specified entity_id. Returns 404 if not found.
258255

259256
```json
260257
{
261-
"attributes": {
262-
"next_rising": "07:04:15 29-10-2013",
263-
"next_setting": "18:00:31 29-10-2013"
264-
},
265-
"entity_id": "sun.sun",
266-
"last_changed": "23:24:33 28-10-2013",
267-
"state": "below_horizon"
258+
"attributes":{
259+
"azimuth":336.34,
260+
"elevation":-17.67,
261+
"friendly_name":"Sun",
262+
"next_rising":"2016-05-31T03:39:14+00:00",
263+
"next_setting":"2016-05-31T19:16:42+00:00"
264+
},
265+
"entity_id":"sun.sun",
266+
"last_changed":"2016-05-30T21:43:29.204838+00:00",
267+
"last_updated":"2016-05-30T21:50:30.529465+00:00",
268+
"state":"below_horizon"
268269
}
269270
```
270271

@@ -310,8 +311,8 @@ Expects a JSON object that has at least a state attribute:
310311
{
311312
"state": "below_horizon",
312313
"attributes": {
313-
"next_rising": "07:04:15 29-10-2013",
314-
"next_setting": "18:00:31 29-10-2013"
314+
"next_rising":"2016-05-31T03:39:14+00:00",
315+
"next_setting":"2016-05-31T19:16:42+00:00"
315316
}
316317
}
317318
```
@@ -321,11 +322,12 @@ Return code is 200 if the entity existed, 201 if the state of a new entity was s
321322
```json
322323
{
323324
"attributes": {
324-
"next_rising": "07:04:15 29-10-2013",
325-
"next_setting": "18:00:31 29-10-2013"
325+
"next_rising":"2016-05-31T03:39:14+00:00",
326+
"next_setting":"2016-05-31T19:16:42+00:00"
326327
},
327-
"entity_id": "weather.sun",
328-
"last_changed": "23:24:33 28-10-2013",
328+
"entity_id": "sun.sun",
329+
"last_changed": "2016-05-30T21:43:29.204838+00:00",
330+
"last_updated": "2016-05-30T21:47:30.533530+00:00"
329331
"state": "below_horizon"
330332
}
331333
```
@@ -345,7 +347,7 @@ You can pass an optional JSON object to be used as `event_data`.
345347

346348
```json
347349
{
348-
"next_rising": "18:00:31 29-10-2013"
350+
next_rising":"2016-05-31T03:39:14+00:00",
349351
}
350352
```
351353

@@ -373,18 +375,15 @@ Returns a list of states that have changed while the service was being executed.
373375
```json
374376
[
375377
{
376-
"attributes": {
377-
"next_rising": "07:04:15 29-10-2013",
378-
"next_setting": "18:00:31 29-10-2013"
379-
},
378+
"attributes": {},
380379
"entity_id": "sun.sun",
381-
"last_changed": "23:24:33 28-10-2013",
380+
"last_changed": "2016-05-30T21:43:32.418320+00:00",
382381
"state": "below_horizon"
383382
},
384383
{
385384
"attributes": {},
386385
"entity_id": "process.Dropbox",
387-
"last_changed": "23:24:33 28-10-2013",
386+
"last_changed": "22016-05-30T21:43:32.418320+00:00",
388387
"state": "on"
389388
}
390389
]

0 commit comments

Comments
 (0)