ruby-macrodroid 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 652f6174d50060ca2b7e3197c2bc79062ed6af498b1982ef8c73e27b0422ad85
4
- data.tar.gz: 86096eb1c1fef612666065e0e3d48c619b4768d801723b6beaa273687d643fec
3
+ metadata.gz: 3784001df302ddb9f8389ea019f860925803b96913f4531839df140f48634857
4
+ data.tar.gz: 686838c12129f1cd329d72745f37a7cb81ed91d98cdea059a5b59938d6d8b9e3
5
5
  SHA512:
6
- metadata.gz: f9705342b8176dc48a5bfca362a17e340bfd56f67d2eafa3b20602fa493d02cbf5a9cbfe13b2dfb02565a74bb02bf01477de6884151a659fab4500c4b2cbfea4
7
- data.tar.gz: 6e7bae11b8cf64ff3b0efd4f852f6bb8c2e419aa8d25693aeb894dde64c063c2dbcf9abe9bddf5dbe87cb630d8fa6e6c183d105b6b71fedee804918a79467489
6
+ metadata.gz: 948ceb9a759bf97fd4e4786fe35f95aee1a76d971ced0553c3984a885bae87155a18747a77c27d2daf7e928847cd503e19820e648956b0a93a62ef056a5992a9
7
+ data.tar.gz: d9ae51714a522375bd2aa92410f4a9412d83903d29ca33892cdd55a61dfab08faf7d02da292bdda2506715ca6948cdd308e0be4a03eb16b8010f5b56dd291ce0
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -709,6 +709,9 @@ class SetHotspotAction < ConnectivityAction
709
709
 
710
710
  def initialize(h={})
711
711
 
712
+ # to-do: check when *disable hotspot*, is the
713
+ # *enable wifi* option selected?
714
+
712
715
  options = {
713
716
  device_name: "", state: 0, turn_wifi_on: true, use_legacy_mechanism: false, mechanism: 0
714
717
 
@@ -719,8 +722,15 @@ class SetHotspotAction < ConnectivityAction
719
722
  end
720
723
 
721
724
  def to_s(colour: false, indent: 0)
722
- action = @h[:turn_wifi_on] ? 'Enable' : 'Disable'
723
- action + ' HotSpot'
725
+
726
+ @s = "%s HotSpot" % [@h[:state] == 0 ? 'Enable' : 'Disable']
727
+
728
+ if @h[:state] == 1 then
729
+ @s += "\n" + (@h[:turn_wifi_on] ? 'Enable WiFi' : 'Don\'t Enable Wifi')
730
+ end
731
+
732
+ super()
733
+
724
734
  end
725
735
  end
726
736
 
@@ -799,9 +799,17 @@ class MacroDroidVariableConstraint < Constraint
799
799
  h[:variable][:name] = h[:loperand]
800
800
  h[:variable][:type] = 2
801
801
 
802
- val = h[:roperand] =~ /true|false/ ? h[:roperand].capitalize \
803
- : h[:roperand]
804
- h[:string_value] = val
802
+ if h[:roperand] =~ /true|false/i then
803
+
804
+ val = h[:roperand].downcase == 'true'
805
+ h[:boolean_value] = val
806
+ h[:variable][:type] = 0
807
+ h[:variable][:boolean_value] = val
808
+ h[:string_value] = h[:roperand].capitalize
809
+ else
810
+ h[:string_value] = h[:roperand]
811
+ end
812
+
805
813
  end
806
814
 
807
815
  options = {
@@ -175,7 +175,18 @@ class ActionsNlp
175
175
  end
176
176
 
177
177
  def actions(params)
178
-
178
+
179
+ # -- Connectivity ------------------------------------------------------
180
+
181
+ get /^(Enable|Disable) HotSpot/i do |state|
182
+ enable, state = if state.downcase == 'enable' then
183
+ [true, 0]
184
+ else
185
+ [false, 1]
186
+ end
187
+ [SetHotspotAction, {turn_wifi_on: enable, state: state }]
188
+ end
189
+
179
190
  # e.g. message popup: hello world!
180
191
  get /^message popup: (.*)/i do |msg|
181
192
  [ToastAction, {msg: msg}]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-macrodroid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  NZ2kdBIUDnAM24e0/wXdVxg4HnsZbdymxyzMQ4P5pKYcpI6oisBxI37p/Xy+wAg3
36
36
  SBHno3GEuuD8ZWj24IMJpfbp
37
37
  -----END CERTIFICATE-----
38
- date: 2020-10-13 00:00:00.000000000 Z
38
+ date: 2020-10-14 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: glw
metadata.gz.sig CHANGED
Binary file