eufycam 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/default.yml +4 -0
- data/Dockerfile +27 -0
- data/Gemfile.lock +3 -3
- data/README.md +9 -2
- data/docker-compose.yml +14 -0
- data/eufycam.gemspec +2 -1
- data/exe/eufycam +1 -2
- data/lib/eufycam/cli.rb +29 -6
- data/lib/eufycam/version.rb +1 -1
- metadata +25 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83ba1530498979809ceec9a6faeee9c51870754d22df118ffd27e25be38f5162
|
4
|
+
data.tar.gz: d34cef190e53bbc8df1304ef69b7102ad19ae155d35b626eb72ba51d4cc8457e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f452985f7bd95c78d6e2c753f87ad731e8fb400286a2c110f78a04d1e86699d91600cc75f91b328f7cce39aa591d268da7daa602327dcb5db009d94d309fc300
|
7
|
+
data.tar.gz: 7de22be43aac6f5247945d1a4ab22da32e0f36f122ac4db446466246f37b026ff7738e9595f9e7dad5f096069fd6dcc34b6a237f016b84fdf904a82c0e873e94
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @kyledecot
|
@@ -137,6 +137,10 @@ jobs:
|
|
137
137
|
release_name: ${{ github.ref }}
|
138
138
|
draft: false
|
139
139
|
prerelease: false
|
140
|
+
- name: Docker
|
141
|
+
run: docker build . -t kyledecot/eufycam:latest
|
142
|
+
- run: echo ${{ secrets.DOCKER_PASSWORD}} docker login -u ${{ secrets.DOCKER_USERNAME}} --password-stdin
|
143
|
+
- run: docker push kyledecot/eufycam:latest
|
140
144
|
|
141
145
|
- name: Upload Release Asset
|
142
146
|
uses: actions/upload-release-asset@v1
|
data/Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
FROM ruby:2.6.5-alpine AS build
|
2
|
+
|
3
|
+
VOLUME ["/data"]
|
4
|
+
|
5
|
+
RUN gem install bundler
|
6
|
+
|
7
|
+
RUN apk add --update-cache \
|
8
|
+
git \
|
9
|
+
ffmpeg \
|
10
|
+
which \
|
11
|
+
build-base \
|
12
|
+
&& rm -rf /var/cache/apk/*
|
13
|
+
|
14
|
+
COPY . .
|
15
|
+
RUN bundle install --
|
16
|
+
|
17
|
+
RUN bundle exe rake build && \
|
18
|
+
gem install eufycam-$(bundle exec rake version:current).gem
|
19
|
+
|
20
|
+
RUN which ffmpeg
|
21
|
+
RUN which eufycam
|
22
|
+
RUN which ruby
|
23
|
+
|
24
|
+
WORKDIR /data
|
25
|
+
|
26
|
+
ENTRYPOINT ["eufycam"]
|
27
|
+
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eufycam (0.
|
5
|
-
colorize (~> 0.8)
|
4
|
+
eufycam (0.5.0)
|
6
5
|
gli (~> 2.19)
|
6
|
+
lumberjack (~> 1.2)
|
7
|
+
rainbow (~> 3.0)
|
7
8
|
terminal-table (~> 1.8)
|
8
9
|
|
9
10
|
GEM
|
@@ -11,7 +12,6 @@ GEM
|
|
11
12
|
specs:
|
12
13
|
ast (2.4.0)
|
13
14
|
coderay (1.1.2)
|
14
|
-
colorize (0.8.1)
|
15
15
|
diff-lcs (1.3)
|
16
16
|
docile (1.3.2)
|
17
17
|
ffi (1.12.2)
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# eufycam
|
2
2
|
|
3
|
-
![Default](https://github.com/kyledecot/eufycam/workflows/Default/badge.svg)
|
3
|
+
[![Default](https://github.com/kyledecot/eufycam/workflows/Default/badge.svg)](https://github.com/kyledecot/eufycam/actions?query=workflow%3ADefault)
|
4
|
+
|
4
5
|
## Installation
|
5
6
|
|
6
7
|
Add this line to your application's Gemfile:
|
@@ -19,7 +20,13 @@ Or install it yourself as:
|
|
19
20
|
|
20
21
|
## Usage
|
21
22
|
|
22
|
-
|
23
|
+
### CLI
|
24
|
+
|
25
|
+
```bash
|
26
|
+
eufycam help
|
27
|
+
```
|
28
|
+
|
29
|
+
### Ruby
|
23
30
|
|
24
31
|
## Development
|
25
32
|
|
data/docker-compose.yml
ADDED
data/eufycam.gemspec
CHANGED
@@ -25,8 +25,9 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
|
-
spec.add_runtime_dependency 'colorize', '~> 0.8'
|
29
28
|
spec.add_runtime_dependency 'gli', '~> 2.19'
|
29
|
+
spec.add_runtime_dependency 'lumberjack', '~> 1.2'
|
30
|
+
spec.add_runtime_dependency 'rainbow', '~> 3.0'
|
30
31
|
spec.add_runtime_dependency 'terminal-table', '~> 1.8'
|
31
32
|
|
32
33
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
data/exe/eufycam
CHANGED
data/lib/eufycam/cli.rb
CHANGED
@@ -2,13 +2,18 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require 'gli'
|
5
|
+
require 'shellwords'
|
5
6
|
require 'terminal-table'
|
6
|
-
require '
|
7
|
+
require 'rainbow'
|
8
|
+
require 'eufycam'
|
9
|
+
require 'lumberjack'
|
7
10
|
|
8
11
|
module Eufycam
|
9
12
|
class CLI
|
10
13
|
extend GLI::App
|
11
14
|
|
15
|
+
LOGGER = Lumberjack::Logger.new(STDOUT)
|
16
|
+
|
12
17
|
flag 'email',
|
13
18
|
default_value: ENV['EUFYCAM_EMAIL'],
|
14
19
|
arg_name: 'EMAIL'
|
@@ -19,17 +24,35 @@ module Eufycam
|
|
19
24
|
arg_name: 'PASSWORD'
|
20
25
|
|
21
26
|
command :devices do |devices|
|
22
|
-
devices.command
|
23
|
-
timelapse.flag 'device-name', arg_name: 'DEVICE_NAME'
|
27
|
+
devices.command 'timelapse' do |timelapse|
|
28
|
+
timelapse.flag 'device-name', arg_name: 'DEVICE_NAME', desc: 'Device name'
|
29
|
+
timelapse.flag 'interval', arg_name: 'INTERVAL', default_value: 60, desc: 'Interval in seconds', type: Integer
|
30
|
+
|
31
|
+
timelapse.action do |global_options, options, _args|
|
32
|
+
client = Client.new(global_options.slice(:email, :password))
|
33
|
+
|
34
|
+
LOGGER.info("Device Name: #{options['device-name']}")
|
35
|
+
|
36
|
+
url = client.start_stream(
|
37
|
+
device_name: options['device-name']
|
38
|
+
)['url']
|
39
|
+
|
40
|
+
loop do
|
41
|
+
command = "ffmpeg -loglevel quiet -i \"#{url}\" -vframes 1 eufycam-#{Time.now.to_i}.jpg"
|
24
42
|
|
25
|
-
|
26
|
-
# client = Client.new(global_options.slice('username', 'password'))
|
43
|
+
LOGGER.info("COMMAND: #{command}")
|
27
44
|
|
28
|
-
|
45
|
+
`#{command}`
|
46
|
+
|
47
|
+
print '.'
|
48
|
+
sleep options[:interval]
|
49
|
+
end
|
29
50
|
end
|
30
51
|
end
|
31
52
|
|
32
53
|
devices.command 'start-stream' do |start_stream|
|
54
|
+
start_stream.flag 'device-name', arg_name: 'DEVICE_NAME'
|
55
|
+
|
33
56
|
start_stream.action do |global_options, options, _args|
|
34
57
|
client = Client.new(**global_options.slice(:email, :password))
|
35
58
|
|
data/lib/eufycam/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eufycam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Decot
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: gli
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.19'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.19'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: lumberjack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2
|
33
|
+
version: '1.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2
|
40
|
+
version: '1.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rainbow
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: terminal-table
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,6 +186,7 @@ executables:
|
|
172
186
|
extensions: []
|
173
187
|
extra_rdoc_files: []
|
174
188
|
files:
|
189
|
+
- ".github/CODEOWNERS"
|
175
190
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
176
191
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
177
192
|
- ".github/workflows/default.yml"
|
@@ -179,6 +194,7 @@ files:
|
|
179
194
|
- ".rspec"
|
180
195
|
- ".rubocop.yml"
|
181
196
|
- ".ruby-version"
|
197
|
+
- Dockerfile
|
182
198
|
- Gemfile
|
183
199
|
- Gemfile.lock
|
184
200
|
- Guardfile
|
@@ -186,6 +202,7 @@ files:
|
|
186
202
|
- README.md
|
187
203
|
- Rakefile
|
188
204
|
- bin/setup
|
205
|
+
- docker-compose.yml
|
189
206
|
- eufycam.gemspec
|
190
207
|
- exe/eufycam
|
191
208
|
- lib/eufycam.rb
|