ambient-ruby-client 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/ambient/client.rb +2 -2
- data/lib/ambient/device.rb +6 -6
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f24874bd157faa92fd091571baf86d6766378f0589e6a40809277367fb7b2ad6
|
4
|
+
data.tar.gz: d7b93d3009cab106add6b90b78786e77e88bd7432fc12211c6f27b6e3d476615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347abf4d517c36218a7e11a90626d72620458becd9e161c43d39b948d6aab227ce5df8884c5293785212e77ffb95309cba33bd5946c53a3498bd361d2748ce82
|
7
|
+
data.tar.gz: 91f6e7d0659629371d8b0f743b4f86b037abfc1df5c3d3f854a456f6af603cdb88a06f386881e73713fe51558d2dcdf991fc4e327695de0b25e31206bca6e88e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/ambient/client.rb
CHANGED
@@ -41,8 +41,8 @@ module Ambient
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def device_data(device_mac_address, end_date: nil, limit: 288)
|
44
|
-
path = "devices
|
45
|
-
params = {
|
44
|
+
path = "devices/#{device_mac_address}"
|
45
|
+
params = {endDate: end_date, limit: }
|
46
46
|
|
47
47
|
begin
|
48
48
|
response = _get(path, @config, params: )
|
data/lib/ambient/device.rb
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
module Ambient
|
4
4
|
class DeviceInfo
|
5
|
-
attr_reader :name, :
|
5
|
+
attr_reader :name, :coords
|
6
6
|
|
7
7
|
def self.from_hash(data)
|
8
|
-
DeviceInfo.new(data.dig("name"), data.dig("
|
8
|
+
DeviceInfo.new(data.dig("name"), data.dig("coords"))
|
9
9
|
end
|
10
10
|
|
11
|
-
def initialize(name,
|
11
|
+
def initialize(name, coords)
|
12
12
|
@name = name
|
13
|
-
@
|
13
|
+
@coords = coords
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -18,7 +18,7 @@ module Ambient
|
|
18
18
|
attr_reader :mac_address, :info, :last_data
|
19
19
|
|
20
20
|
def self.from_hash(data)
|
21
|
-
Device.new(data.dig("macAddress"), Ambient::DeviceInfo.from_hash(data.dig("info")), data.dig("lastData"))
|
21
|
+
Ambient::Device.new(data.dig("macAddress"), Ambient::DeviceInfo.from_hash(data.dig("info")), data.dig("lastData"))
|
22
22
|
end
|
23
23
|
|
24
24
|
###
|
@@ -28,7 +28,7 @@ module Ambient
|
|
28
28
|
# @param info [Ambient::DeviceInfo] information about the device
|
29
29
|
# @param last_data [Hash] the latest measurement data from the device
|
30
30
|
def initialize(mac_address, info, last_data)
|
31
|
-
@mac_address = mac_address
|
31
|
+
@mac_address = mac_address
|
32
32
|
@info = info
|
33
33
|
@last_data = last_data
|
34
34
|
end
|
data/lib/version.rb
CHANGED