intel-backlight 1.0.1 → 1.0.2
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 +4 -4
- data/lib/backlight.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843cdb05ac49c7dc4eb6a064035ac7b7cf686ff8
|
4
|
+
data.tar.gz: 554b63a05556904d89cf4a531f7da3af9ef72cba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51988cd022fba8f2a43cbce4f720c0eec1f325de141c28f18135725fdc8f17ba434da4e398b02f6788a9bbc3fa0fa88553227d237ee03aa7f869240f7bd5f72
|
7
|
+
data.tar.gz: e9cda49e98d150c557f3538ea48159e309cf91504d25ca158e0fc5c4e024c6c57cb5144b000ad0b282c7f240f256de88efaad3f5f8b190bd9f667dbb6fc526ce
|
data/lib/backlight.rb
CHANGED
@@ -57,7 +57,9 @@ module Backlight
|
|
57
57
|
end
|
58
58
|
|
59
59
|
##
|
60
|
-
# Sets the value of the backlight, from zero to the set maximum
|
60
|
+
# Sets the value of the backlight, from zero to the set maximum. Should
|
61
|
+
# be given in integer form - Strings will be converted, floats will be
|
62
|
+
# truncated.
|
61
63
|
#
|
62
64
|
# ==== Attributes
|
63
65
|
#
|
@@ -71,17 +73,17 @@ module Backlight
|
|
71
73
|
end
|
72
74
|
|
73
75
|
##
|
74
|
-
# Sets the backlight brightness as a percentage
|
76
|
+
# Sets the backlight brightness as a percentage.
|
75
77
|
#
|
76
78
|
def set(percent)
|
77
|
-
self.value = percent * @max / 100
|
79
|
+
self.value = (percent * @max / 100.0).round
|
78
80
|
end
|
79
81
|
|
80
82
|
##
|
81
|
-
# Gets the backlight brightness as a percentage
|
83
|
+
# Gets the backlight brightness as a percentage.
|
82
84
|
#
|
83
85
|
def get
|
84
|
-
100 * @value / @max
|
86
|
+
(100.0 * @value / @max).round
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|