mios 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/.rubocop.yml +769 -0
  2. data/README.md +21 -3
  3. data/lib/mios/action.rb +25 -18
  4. data/lib/mios/category.rb +14 -0
  5. data/lib/mios/category_collection.rb +38 -0
  6. data/lib/mios/client.rb +35 -0
  7. data/lib/mios/device.rb +47 -55
  8. data/lib/mios/interface.rb +53 -37
  9. data/lib/mios/job.rb +33 -34
  10. data/lib/mios/room.rb +14 -0
  11. data/lib/mios/scene.rb +22 -0
  12. data/lib/mios/services/camera1.rb +4 -5
  13. data/lib/mios/services/dimmable_light1.rb +5 -6
  14. data/lib/mios/services/door_lock1.rb +12 -13
  15. data/lib/mios/services/energy_metering1.rb +5 -6
  16. data/lib/mios/services/generic_sensor1.rb +4 -4
  17. data/lib/mios/services/ha_device1.rb +7 -8
  18. data/lib/mios/services/humidity_sensor1.rb +4 -5
  19. data/lib/mios/services/hvac_fan_operating_mode1.rb +3 -4
  20. data/lib/mios/services/hvac_operating_state1.rb +3 -4
  21. data/lib/mios/services/hvac_user_operating_mode1.rb +3 -4
  22. data/lib/mios/services/light_sensor1.rb +4 -12
  23. data/lib/mios/services/scene_controller1.rb +4 -4
  24. data/lib/mios/services/security_sensor1.rb +11 -12
  25. data/lib/mios/services/switch_power1.rb +7 -8
  26. data/lib/mios/services/temperature_sensor1.rb +3 -4
  27. data/lib/mios/services/temperature_setpoint1_cool.rb +3 -4
  28. data/lib/mios/services/temperature_setpoint1_heat.rb +3 -4
  29. data/lib/mios/services/window_covering1.rb +5 -6
  30. data/lib/mios/services/zwave_device1.rb +3 -3
  31. data/lib/mios/services/zwave_network1.rb +3 -3
  32. data/lib/mios/type_conversion.rb +21 -0
  33. data/lib/mios/version.rb +1 -1
  34. data/lib/mios.rb +12 -6
  35. data/mios.gemspec +2 -3
  36. data/spec/integration/lights_spec.rb +17 -0
  37. data/spec/lib/mios/category_collection_spec.rb +37 -0
  38. data/spec/lib/mios/category_spec.rb +15 -0
  39. data/spec/lib/mios/client_spec.rb +28 -0
  40. data/spec/lib/mios/device_spec.rb +69 -6
  41. data/spec/lib/mios/interface_spec.rb +123 -7
  42. data/spec/lib/mios/job_spec.rb +54 -0
  43. data/spec/lib/mios/room_spec.rb +26 -0
  44. data/spec/lib/mios/scene_spec.rb +27 -0
  45. data/spec/lib/mios/services/energy_metering1_spec.rb +1 -1
  46. data/spec/lib/mios/services/hvac_fan_operating_mode1_spec.rb +1 -1
  47. data/spec/lib/mios/services/hvac_operating_state1_spec.rb +1 -1
  48. data/spec/lib/mios/services/hvac_user_operating_mode1_spec.rb +1 -1
  49. data/spec/lib/mios/services/temperature_setpoint1_cool_spec.rb +1 -1
  50. data/spec/lib/mios/services/temperature_setpoint1_heat_spec.rb +1 -1
  51. data/spec/spec_helper.rb +18 -0
  52. data/spec/support/device_data/category_filter.json +75 -0
  53. data/spec/support/device_data/data_request.json +7814 -0
  54. data/spec/support/device_data/device_attributes.json +21 -0
  55. data/spec/support/vcr_cassettes/data_request_failure.yml +28 -0
  56. data/spec/support/vcr_cassettes/run_scene.yml +28 -0
  57. data/spec/support/vcr_cassettes/turn_off_light.yml +2648 -0
  58. data/spec/support/vcr_cassettes/turn_on_light.yml +2647 -0
  59. metadata +57 -39
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "12",
3
+ "device_type": "urn:schemas-upnp-org:device:BinaryLight:1",
4
+ "id_parent": 1,
5
+ "embedded": 0,
6
+ "disabled": 0,
7
+ "device_file": "D_BinaryLight1.xml",
8
+ "impl_file": "",
9
+ "model": "",
10
+ "altid": "5",
11
+ "ip": "",
12
+ "mac": "",
13
+ "time_created": "1350236784",
14
+ "category_num": 3,
15
+ "subcategory_num": 0,
16
+ "name": "On/Off Outlet",
17
+ "manufacturer": "GE/Jasco",
18
+ "room": "1",
19
+ "onDashboard": 1,
20
+ "local_udn": "uuid:4d494342-5342-5645-000c-000002161961"
21
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://192.168.50.21:3480/data_request?id=user_data&output_format=json
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.3.4.1, ruby 2.1.0 (2013-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Sun, 16 Mar 2014 21:45:39 GMT
16
+ response:
17
+ status:
18
+ code: 500
19
+ message: Foo
20
+ headers:
21
+ Content-Type:
22
+ - json
23
+ body:
24
+ encoding: UTF-8
25
+ string: ""
26
+ http_version:
27
+ recorded_at: Sun, 16 Mar 2014 21:45:39 GMT
28
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,28 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://192.168.50.21:3480/data_request?SceneNum=5&action=RunScene&id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - HTTPClient/1.0 (2.3.4.1, ruby 2.1.0 (2013-12-25))
12
+ Accept:
13
+ - "*/*"
14
+ Date:
15
+ - Thu, 08 May 2014 02:53:46 GMT
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - json
23
+ body:
24
+ encoding: UTF-8
25
+ string: "{ \"u:RunSceneResponse\": { \"OK\": \"OK\" } }"
26
+ http_version:
27
+ recorded_at: Thu, 08 May 2014 02:53:46 GMT
28
+ recorded_with: VCR 2.8.0