mios 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.rubocop.yml +769 -0
- data/README.md +21 -3
- data/lib/mios/action.rb +25 -18
- data/lib/mios/category.rb +14 -0
- data/lib/mios/category_collection.rb +38 -0
- data/lib/mios/client.rb +35 -0
- data/lib/mios/device.rb +47 -55
- data/lib/mios/interface.rb +53 -37
- data/lib/mios/job.rb +33 -34
- data/lib/mios/room.rb +14 -0
- data/lib/mios/scene.rb +22 -0
- data/lib/mios/services/camera1.rb +4 -5
- data/lib/mios/services/dimmable_light1.rb +5 -6
- data/lib/mios/services/door_lock1.rb +12 -13
- data/lib/mios/services/energy_metering1.rb +5 -6
- data/lib/mios/services/generic_sensor1.rb +4 -4
- data/lib/mios/services/ha_device1.rb +7 -8
- data/lib/mios/services/humidity_sensor1.rb +4 -5
- data/lib/mios/services/hvac_fan_operating_mode1.rb +3 -4
- data/lib/mios/services/hvac_operating_state1.rb +3 -4
- data/lib/mios/services/hvac_user_operating_mode1.rb +3 -4
- data/lib/mios/services/light_sensor1.rb +4 -12
- data/lib/mios/services/scene_controller1.rb +4 -4
- data/lib/mios/services/security_sensor1.rb +11 -12
- data/lib/mios/services/switch_power1.rb +7 -8
- data/lib/mios/services/temperature_sensor1.rb +3 -4
- data/lib/mios/services/temperature_setpoint1_cool.rb +3 -4
- data/lib/mios/services/temperature_setpoint1_heat.rb +3 -4
- data/lib/mios/services/window_covering1.rb +5 -6
- data/lib/mios/services/zwave_device1.rb +3 -3
- data/lib/mios/services/zwave_network1.rb +3 -3
- data/lib/mios/type_conversion.rb +21 -0
- data/lib/mios/version.rb +1 -1
- data/lib/mios.rb +12 -6
- data/mios.gemspec +2 -3
- data/spec/integration/lights_spec.rb +17 -0
- data/spec/lib/mios/category_collection_spec.rb +37 -0
- data/spec/lib/mios/category_spec.rb +15 -0
- data/spec/lib/mios/client_spec.rb +28 -0
- data/spec/lib/mios/device_spec.rb +69 -6
- data/spec/lib/mios/interface_spec.rb +123 -7
- data/spec/lib/mios/job_spec.rb +54 -0
- data/spec/lib/mios/room_spec.rb +26 -0
- data/spec/lib/mios/scene_spec.rb +27 -0
- data/spec/lib/mios/services/energy_metering1_spec.rb +1 -1
- data/spec/lib/mios/services/hvac_fan_operating_mode1_spec.rb +1 -1
- data/spec/lib/mios/services/hvac_operating_state1_spec.rb +1 -1
- data/spec/lib/mios/services/hvac_user_operating_mode1_spec.rb +1 -1
- data/spec/lib/mios/services/temperature_setpoint1_cool_spec.rb +1 -1
- data/spec/lib/mios/services/temperature_setpoint1_heat_spec.rb +1 -1
- data/spec/spec_helper.rb +18 -0
- data/spec/support/device_data/category_filter.json +75 -0
- data/spec/support/device_data/data_request.json +7814 -0
- data/spec/support/device_data/device_attributes.json +21 -0
- data/spec/support/vcr_cassettes/data_request_failure.yml +28 -0
- data/spec/support/vcr_cassettes/run_scene.yml +28 -0
- data/spec/support/vcr_cassettes/turn_off_light.yml +2648 -0
- data/spec/support/vcr_cassettes/turn_on_light.yml +2647 -0
- 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
|