humble_rpi-plugin-lirc 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1b9a65fe60f95892fc4561743e06ebd99080800d
4
+ data.tar.gz: c25c7e53ac8469020a42798404859732b46c5af5
5
+ SHA512:
6
+ metadata.gz: 5d73b8e74ba2f0e1e22434438e43c780f8ff995805f973624c127d848553850c5b566f7f477b7b2c7400210746bf2e93f4d2d488b2e4fbc9569b12f2c61364c5
7
+ data.tar.gz: 2fd3fff2ca45e4b4f759b901281528cca4c72de06b9174f037c0641fb2fe2622181d38f7fe727a4b6d9cb4fbdd3c1c98a9b865c9c4939dc07e78084b5444ca7a
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ m�hh{֢��a�n���h}e�N�s�U��8���a˦mnv@�\'���7�Oa�����nrK��?<�8}�tp�m����:�����ڈQ�$�#���9Yjf�\m�UI�����۱��g�{e��>f�J�J�w�d�T
2
+ ���u0��?�1��#^�Y�k��ݍ��t��B�<*Ȭ�T���Ը�r�x���e�3�b�-��f�誙3
data.tar.gz.sig ADDED
Binary file
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: humble_rpi-plugin-lirc.rb
4
+
5
+ require 'lirc'
6
+
7
+
8
+ class HumbleRPiPluginLirc
9
+
10
+ def initialize(settings: {}, variables: {})
11
+
12
+ @notifier = variables[:notifier]
13
+ @device_id = variables[:device_id] || 'pi'
14
+ @topic = settings[:topic] || @device_id + '/lirc'
15
+
16
+ end
17
+
18
+ def start()
19
+
20
+ lirc = LIRC::Client.new
21
+ combi_keys = []
22
+ combination_keys = false
23
+
24
+ t = Time.now
25
+ puts 'HumbleRpiPluginLirc ready'
26
+
27
+ lirc.each_event do |e|
28
+
29
+ if t + 0.6 < Time.now then
30
+
31
+ on_keypress(e.name)
32
+
33
+ (combination_keys = true; next) if e.name == 'KEY_MODE'
34
+
35
+ if combination_keys then
36
+
37
+ if e.name == 'KEY_ENTER' then
38
+
39
+ combination_keys = false
40
+ @notifier.notice "%s: KEYS_%s pressed" % [@topic, combi_keys.join]
41
+ combi_keys = []
42
+ else
43
+ combi_keys << e.name[/[^_]+$/]
44
+ end
45
+
46
+ else
47
+ @notifier.notice "%s: %s pressed" % [@topic, e.name]
48
+ end
49
+ end
50
+
51
+ t = Time.now
52
+ end
53
+ end
54
+
55
+ private
56
+
57
+ def on_keypress(key)
58
+ end
59
+
60
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: humble_rpi-plugin-lirc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE1MDYxNTA2MzkxNVoXDTE2MDYxNDA2MzkxNVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBANQdTCwkY42znVbuqonfDGm6ggmWZPUNhIufPv68Hsz6k36c9JjFFHtClWQ8
19
+ FwzFuf1Zmvod+JiFF+goT7jXnSwKupOCgJKjUpMT5jL4CWteh07qmelRbiaFZNtJ
20
+ Lsq4LOJVU2Twe7xmmk3dtiIbuuRXXy2XV7lucIAZhCEK7x1Ij0yLmIyoTSCAa82l
21
+ zpMazH00j3IYcyv820GRgoeMZKgkB/VGAl/O3YFrdJn0UuCzlFZMtxELFfUY0V/4
22
+ SqXMmwwXujKekg6ZH9bQpbBMfqiyua0WE8XSmtIQ3zfAen2FafKuDmLw09j8ulJ9
23
+ 1dlE/as6FKYVtoTQUuTiC2Jrbc8CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUlmeWuVbs87av6TRCRB6mf386D+UwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAcOTsl5eC
27
+ udRFAngxe4YAJDGCltVpnXTtY8LD1sGhynZYGWkPMwzuApvQH6nPzcr3OkAGOk/6
28
+ KH62Gr3wgBW1QU5N8kcQK2qw2sypw8rLJbYsyE5Y5RYammq/IEjBaq/vz/+EceDU
29
+ 8Nj1TJcGHBPzoVJlXnVLeB+EbU8DPX/SVI7q+LL7h+LVE1iq8cfmZVvvdWhmED9g
30
+ bIfqbObH96s22jlMOi6LQpjz3mTqeo8qra8l6NdLqE64rC7V/OJxAok+n4CUyKcW
31
+ 5oG+s+SDUQWXxFJfLwGwk/bLDztK9euedcNNn5FHUyeJDB7slSW2uMnZgzc5J1d2
32
+ ceAZ3m6mV3sQJQ==
33
+ -----END CERTIFICATE-----
34
+ date: 2015-06-15 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: lirc
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.0'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.0.3
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.0'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.0.3
56
+ description:
57
+ email: james@r0bertson.co.uk
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/humble_rpi-plugin-lirc.rb
63
+ homepage: https://github.com/jrobertson/humble_rpi-plugin-lirc
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.4.6
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: A humble_rpi plugin which handles a button press from an LIRC remote contol.
87
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ �x����� ��˽p9��F��/;x���o}e���I랞�}�E�*��ϵT1�0�X���a3�>"Y�x�u(
2
+ bn������V����hw���h�~���H�pݔ����"��xʞM� }