Module: Sense::Timeline
- Included in:
- Client
- Defined in:
- lib/hello_sense/timeline.rb
Instance Method Summary collapse
- #create_timeline_event(date, type, timestamp, data) ⇒ Object
- #remove_timeline_event(date, type, timestamp) ⇒ Object
-
#timeline(date) ⇒ Hash
Known event_types: *
FELL_ASLEEP*GENERIC_MOTION*GENERIC_SOUND*GOT_IN_BED*GOT_OUT_OF_BED*IN_BED*WOKE_UP. - #update_timeline_event(date, type, timestamp, data) ⇒ Object
Instance Method Details
#create_timeline_event(date, type, timestamp, data) ⇒ Object
73 74 75 |
# File 'lib/hello_sense/timeline.rb', line 73 def create_timeline_event(date, type, , data) put("/v2/timeline/#{date}/events/#{type}/#{timestamp}", data) end |
#remove_timeline_event(date, type, timestamp) ⇒ Object
81 82 83 |
# File 'lib/hello_sense/timeline.rb', line 81 def remove_timeline_event(date, type, ) delete("/v2/timeline/#{date}/events/#{type}/#{timestamp}") end |
#timeline(date) ⇒ Hash
Known event_types:
-
FELL_ASLEEP -
GENERIC_MOTION -
GENERIC_SOUND -
GOT_IN_BED -
GOT_OUT_OF_BED -
IN_BED -
WOKE_UP
Known sleep_states:
-
AWAKE -
LIGHT -
MEDIUM -
SOUND
Known metrics names:
-
fell_asleep -
sound_sleep -
time_to_sleep -
times_awake -
total_sleep -
woke_up -
humidity -
light -
particulates -
sound -
temperature
69 70 71 |
# File 'lib/hello_sense/timeline.rb', line 69 def timeline(date) get("/v2/timeline/#{date}") end |
#update_timeline_event(date, type, timestamp, data) ⇒ Object
77 78 79 |
# File 'lib/hello_sense/timeline.rb', line 77 def update_timeline_event(date, type, , data) patch("/v2/timeline/#{date}/events/#{type}/#{timestamp}", data) end |