Class: DeviceAPI::Android::Plugin::Battery
- Inherits:
-
Object
- Object
- DeviceAPI::Android::Plugin::Battery
- Defined in:
- lib/device_api/android/plugins/battery.rb
Instance Attribute Summary collapse
-
#current_temp ⇒ Object
readonly
Returns the value of attribute current_temp.
-
#health ⇒ Object
readonly
Returns the value of attribute health.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#max_current ⇒ Object
readonly
Returns the value of attribute max_current.
-
#max_temp ⇒ Object
readonly
Returns the value of attribute max_temp.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#voltage ⇒ Object
readonly
Returns the value of attribute voltage.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Battery
constructor
A new instance of Battery.
Constructor Details
#initialize(options = {}) ⇒ Battery
Returns a new instance of Battery.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/device_api/android/plugins/battery.rb', line 7 def initialize( = {}) qualifier = [:qualifier] props = ADB.get_battery_info(qualifier) @current_temp = props["temperature"] @max_temp = props["mBatteryMaxTemp"] @max_current = props["mBatteryMaxCurrent"] @voltage = props["voltage"] @level = props["level"] @health = props["health"] @status = props["status"] end |
Instance Attribute Details
#current_temp ⇒ Object (readonly)
Returns the value of attribute current_temp.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def current_temp @current_temp end |
#health ⇒ Object (readonly)
Returns the value of attribute health.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def health @health end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def level @level end |
#max_current ⇒ Object (readonly)
Returns the value of attribute max_current.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def max_current @max_current end |
#max_temp ⇒ Object (readonly)
Returns the value of attribute max_temp.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def max_temp @max_temp end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def status @status end |
#voltage ⇒ Object (readonly)
Returns the value of attribute voltage.
5 6 7 |
# File 'lib/device_api/android/plugins/battery.rb', line 5 def voltage @voltage end |