smartware 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,10 +31,6 @@ module Smartware
31
31
  "#{rand(90)*100+rand(9)} " + %w(руб. dollars тэньге).sample
32
32
  end
33
33
 
34
- def balance
35
- ussd
36
- end
37
-
38
34
  end
39
35
 
40
36
  end
@@ -52,13 +52,6 @@ module Smartware
52
52
  #
53
53
  # Valid ussd answer sample: ["", "+CUSD: 2,\"003100310035002C003000300440002E00320031002E00330031002004310430043B002E0020\",72", "OK"]
54
54
  #
55
- def balance
56
- loop do
57
- break if @balance = ussd('*100#')
58
- sleep 0.5
59
- end
60
- end
61
-
62
55
  def ussd(code="*100#")
63
56
  res = self.send "AT+CUSD=1,\"#{code}\",15"
64
57
  unless res[1][0..4] == "+CUSD"
@@ -52,7 +52,7 @@ module Smartware
52
52
  @status[:signal_level] = @device.signal_level
53
53
  @status[:model] = @device.model
54
54
  @status[:error] = @device.error
55
- @status[:balance] = @device.balance
55
+ @status[:balance] = balance if balance = @device.ussd("*100#")
56
56
  sleep 30
57
57
  end
58
58
  end
@@ -1,3 +1,3 @@
1
1
  module Smartware
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: