alula-ruby 1.9.9 → 1.9.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 862f2ea01185662b9fe69c4a124cae5319bf239e20093c310aff126099837bec
4
- data.tar.gz: c93506e0d79bec648766cf8f9ef984e0faf51e7cf7c675b712d9e8ebe3911449
3
+ metadata.gz: f010ddbce82b3847631382e487cc1f9f8af49dcce8fad463186f57522d4d482a
4
+ data.tar.gz: 274290d154f94c8a533d5c23dff8e60249c268f4f192cffb294a60c1e96bdbea
5
5
  SHA512:
6
- metadata.gz: 694b237a5d7430b5115d765339953f973a86d0fd54437590cc7aafb70b9dbd122f2c28082d259769c01849fc2cfc19a3f59a1262e7f4c2514add4d5fe74febdf
7
- data.tar.gz: 9f51666dda26193152508e567f57305ab5315470e6d0e0a5256bb5b50c2243bdf48e27b1bbc46dc00cf817efdeaf4c6bd11b514edec9b2f3ec27763c3f5eff7d
6
+ metadata.gz: 817956a2ef5d2d00fd03c67df0dfb02daa9a87c3a7dc1bd6b481616ba303c00febc3083242ed70159a1a205c760a4c79ebb4c46691b31bdc245deeb588f281bf
7
+ data.tar.gz: 43dfafec207e88331db814806ad312d8572b6a9c246ff043a6c7c0ace8221b87d6d30c31612ce251ef52188d4ab9c5c6416b85f3cd8991a46f2ae50ae03c8d95
data/VERSION.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  | Version | Date | Description |
4
4
  | ------- | ------------| --------------------------------------------------------------------------- |
5
+ | v1.9.11 | 2024-08-22 | Fixing incorrect payload format for set recording config proc |
6
+ | v1.9.10 | 2024-08-15 | Overriding RPC response for camera config and server config procs |
5
7
  | v1.9.9 | 2024-08-15 | Giving camera server config call a payload field, updated response data for svrConfig + recConfig |
6
8
  | v1.9.8 | 2024-08-14 | Allow force for get camera wifi |
7
9
  | v1.9.7 | 2024-08-13 | Update base RPC class to handle response |
@@ -3,16 +3,12 @@
3
3
  module Alula
4
4
  class CameraGetRecordingConfigProc < Alula::RpcResource
5
5
  class Response < Alula::RpcResponse
6
- attr_accessor :cmd, :result
6
+ attr_accessor :result
7
7
 
8
8
  def initialize(response)
9
9
  super(response)
10
10
  @result = response.data.dig('data', 'data')
11
11
  end
12
-
13
- def ok?
14
- super && @cmd == 'getRecordConfig'
15
- end
16
12
  end
17
13
 
18
14
  def self.call(serial_number:)
@@ -3,16 +3,12 @@
3
3
  module Alula
4
4
  class CameraGetServerConfigProc < Alula::RpcResource
5
5
  class Response < Alula::RpcResponse
6
- attr_accessor :cmd, :result
6
+ attr_accessor :result
7
7
 
8
8
  def initialize(response)
9
9
  super(response)
10
10
  @result = response.data.dig('data', 'data')
11
11
  end
12
-
13
- def ok?
14
- super && @cmd == 'getSvrConfig'
15
- end
16
12
  end
17
13
 
18
14
  def self.call(serial_number:)
@@ -1,22 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # rubocop:disable Metrics/MethodLength
3
4
  module Alula
4
5
  class CameraSetRecordingConfigProc < Alula::RpcResource
5
6
  class Response < Alula::RpcResponse
6
- end
7
+ attr_accessor :result
7
8
 
8
- def self.call(event:, allday:)
9
- payload = {
10
- "event": event,
11
- "allday": allday
12
- }
9
+ def initialize(response)
10
+ super(response)
11
+ @result = response.data['data']
12
+ @cmd = response
13
+ end
14
+ end
13
15
 
16
+ def self.call(serial_number:, record_mode:, pre_seconds:, post_seconds:)
14
17
  request(
15
18
  http_method: :post,
16
- path: "/v1/device/#{serial_number}/recordConfig",
17
- payload: payload,
18
- handler: Response
19
+ path: "/video/v1/device/#{serial_number}/recordConfig",
20
+ payload: {
21
+ event: {
22
+ recordMode: record_mode,
23
+ preSeconds: pre_seconds.to_i,
24
+ postSeconds: post_seconds.to_i
25
+ },
26
+ allday: {
27
+ mode: 'NULL'
28
+ }
29
+ },
30
+ handler: Response,
31
+ wrap: false
19
32
  )
20
33
  end
21
34
  end
22
35
  end
36
+
37
+ # rubocop:enable Metrics/MethodLength
@@ -3,17 +3,19 @@
3
3
  module Alula
4
4
  class CameraSetServerConfigProc < Alula::RpcResource
5
5
  class Response < Alula::RpcResponse
6
+ attr_accessor :result
7
+
8
+ def initialize(response)
9
+ super(response)
10
+ @result = response.data['data']
11
+ end
6
12
  end
7
13
 
8
14
  def self.call(serial_number:, should_use_s3:)
9
- payload = {
10
- "shouldUseS3": should_use_s3
11
- }
12
-
13
15
  request(
14
16
  http_method: :post,
15
17
  path: "/video/v1/device/#{serial_number}/svrConfig",
16
- payload: payload,
18
+ payload: { shouldUseS3: should_use_s3 },
17
19
  handler: Response
18
20
  )
19
21
  end
data/lib/alula/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alula
4
- VERSION = '1.9.9'
4
+ VERSION = '1.9.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alula-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.9
4
+ version: 1.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Titus Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty