tesla_api 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tesla_api/stream.rb +10 -10
- data/lib/tesla_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3006f2782cd9fae5deaeaeb96bc24316adb52f890ceb7a9222f48cc15e55cf71
|
4
|
+
data.tar.gz: 108132c98dbb6c7abe62c7437ebafec58238f447238cc2f71da2b8c6eb387f7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f4ab21d5dd77265da3d0dd10d89a775b75dfd0807495616012a2e25049f7f046ef898d80c4b8f108d9d9f03b0e90205ce566d80f3d7d4c7284eada298e031b5
|
7
|
+
data.tar.gz: 0ec939e1e12db9103fa76fb4f9fadbcd6cf3c84d17dd2a7480d5d9b42ed91e68cad822953cfe2203fe6fca8424143871bde001d59284edae4342f714cd4788bd
|
data/lib/tesla_api/stream.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
module TeslaApi
|
2
2
|
module Stream
|
3
|
-
def
|
3
|
+
def self.streaming_endpoint_url
|
4
|
+
'wss://streaming.vn.teslamotors.com/streaming/'
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.streaming_endpoint
|
8
|
+
Async::HTTP::Endpoint.parse(streaming_endpoint_url, alpn_protocols: Async::HTTP::Protocol::HTTP11.names)
|
9
|
+
end
|
10
|
+
|
11
|
+
def stream(endpoint: Stream.streaming_endpoint, &receiver)
|
4
12
|
Async do |task|
|
5
|
-
Async::WebSocket::Client.connect(
|
13
|
+
Async::WebSocket::Client.connect(endpoint) do |connection|
|
6
14
|
on_timeout = ->(subtask) do
|
7
15
|
subtask.sleep TIMEOUT
|
8
16
|
task.stop
|
@@ -46,14 +54,6 @@ module TeslaApi
|
|
46
54
|
|
47
55
|
TIMEOUT = 30
|
48
56
|
|
49
|
-
def streaming_endpoint
|
50
|
-
Async::HTTP::Endpoint.parse(streaming_endpoint_url)
|
51
|
-
end
|
52
|
-
|
53
|
-
def streaming_endpoint_url
|
54
|
-
'wss://streaming.vn.teslamotors.com/streaming/'
|
55
|
-
end
|
56
|
-
|
57
57
|
def streaming_connect_message
|
58
58
|
{
|
59
59
|
msg_type: 'data:subscribe',
|
data/lib/tesla_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tesla_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Dorr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-websocket
|