import_remotecontrol 0.3.7 → 0.3.8
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 +8 -8
- data/lib/get_code_list.rb +14 -1
- data/lib/import_code.rb +4 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmY4YThmYjBhNzA4ODczZWE0ZmI1NWEwYjViMDcwZGU3ZWQzNGExNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTE0MzE4M2IwOWRkMDI2OWY1NzdkODc4OTY3ZTljZDBlM2RlZGVhMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWRlYzQ0YWZjODdhZmMwMzkzNTQ0YTg3YzI0ODcxMjAyZDE5MTcyOGJhNDE3
|
10
|
+
MWM0Y2NiMzY3YTkzYjJkNGM0NTkyMjYyMjBkZTY2MjMzZjU2MjQyOWY3Mjk4
|
11
|
+
MmJhMjllMGYwNWQ3NGE2ZDRiNTM3MTQ2ZTY5Yzg1ZWZiZTNjNTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTBjMWJmODhhMDAzNDliNjgzZTM5MDI1OTU0ODYyMjlkZTMxNWYwZjRmMTg2
|
14
|
+
ZTRiMjdhODdmYTg1Mjc2YjNmZTMwZmQwYzJmNDg2MTc2MmJhNzRkOTYxMWFi
|
15
|
+
Y2ZhZDBlMjE1NzJlNjc5NzNlOTUzY2Q3ZmJjNGFmMzA1NGZjM2U=
|
data/lib/get_code_list.rb
CHANGED
@@ -139,6 +139,19 @@ module GetCodeList
|
|
139
139
|
end
|
140
140
|
|
141
141
|
|
142
|
+
#获取反码只转换2位16进制数的后6位
|
143
|
+
def self.radix_minus_one_complement_only_last_6(code)
|
144
|
+
begin
|
145
|
+
code = "0" + code if code.size==1
|
146
|
+
ret = ""
|
147
|
+
ret = ((~((code).to_i(16)))&Integer(0b111111)).to_s(16)
|
148
|
+
rescue
|
149
|
+
raise RuntimeError, get_error_msg("get radix-minus-one complement Error, Error msg : #{err.to_s}",{METHOD_NAME => "radix_minus_one_complement"})
|
150
|
+
end
|
151
|
+
ret
|
152
|
+
end
|
153
|
+
|
154
|
+
|
142
155
|
|
143
156
|
#对长虹的扩展NEC编码类型的编码数组进行处理
|
144
157
|
def self.changHongExtNec(prtotoname,code)
|
@@ -186,7 +199,7 @@ module GetCodeList
|
|
186
199
|
def self.sharp(prtotoname,code)
|
187
200
|
begin
|
188
201
|
codes = code.split(":")
|
189
|
-
ret = "#{prtotoname}:#{codes[0]}:#{codes[1]}:#{codes[2]}:#{codes[0]}:#{
|
202
|
+
ret = "#{prtotoname}:#{codes[0]}:#{codes[1]}:#{codes[2]}:#{codes[0]}:#{radix_minus_one_complement_only_last_6(codes[1])}:#{radix_minus_one_complement_only_last_6(codes[2])}:#{codes[0]}:#{codes[1]}:#{codes[2]}"
|
190
203
|
rescue => err
|
191
204
|
raise RuntimeError, get_error_msg("Protocol Error, Error msg : #{err.to_s}",{METHOD_NAME => "Rac"})
|
192
205
|
end
|
data/lib/import_code.rb
CHANGED
@@ -26,7 +26,10 @@ module ImportCode
|
|
26
26
|
DEFAULT_CODENAME = {"机顶盒电源"=>"power","静音"=>"voice_quiet","菜单"=>"menu",
|
27
27
|
"上"=>"up","下"=>"down","左"=>"left","右"=>"right",
|
28
28
|
"音量+"=>'voice_up',"音量-"=>"voice_down",
|
29
|
-
"频道+"=>"channel_up","频道-"=>"channel_down"
|
29
|
+
"频道+"=>"channel_up","频道-"=>"channel_down","上一页"=>"previous_page",
|
30
|
+
"下一页"=>"next_page","返回"=>"return","快进"=>"fast_forward",
|
31
|
+
"快退"=>"rew","播放/暂停"=>"play","停止播放"=>"stop","回看"=>"look_back",
|
32
|
+
"删除"=>"delete","TV/AV"=>"tv_av","-/--"=>"switch"}
|
30
33
|
|
31
34
|
|
32
35
|
#需要将属性值进行转换的
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: import_remotecontrol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zql
|
@@ -43,4 +43,3 @@ signing_key:
|
|
43
43
|
specification_version: 4
|
44
44
|
summary: only use import remote control code
|
45
45
|
test_files: []
|
46
|
-
has_rdoc:
|