openhab-scripting 2.25.1 → 2.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openhab/dsl/types/datetime.rb +12 -0
- data/lib/openhab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3deb9da52443a92a787b19c30a5e540bf45ffa1f2ce69e7b47554190468e311
|
4
|
+
data.tar.gz: eae005970cf7f0c47f896fa9e2ab194c1a8c23b8901b535cde8b66efcc864e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc8e075065e222e388a0c8b83a53644ea0b6d909f7c7c1109450f4be535a91e77319fa4d73e950df6ad9023bfc8051a242dcafcf51a1ff96934c6a43a9a8b51
|
7
|
+
data.tar.gz: b869685445af147f35ce27a793c8f533fdc39af25842935cd1c3265610383d0332830fae97edb4746a49dc96fd7f351debcb7e1eb28646c174dff03cef5e1c7f
|
@@ -22,11 +22,14 @@ module OpenHAB
|
|
22
22
|
|
23
23
|
def_delegator :datetime, :to_s
|
24
24
|
def_delegator :zoned_date_time, :month_value, :month
|
25
|
+
def_delegator :zoned_date_time, :day_of_month, :mday
|
26
|
+
def_delegator :zoned_date_time, :day_of_year, :yday
|
25
27
|
def_delegator :zoned_date_time, :minute, :min
|
26
28
|
def_delegator :zoned_date_time, :second, :sec
|
27
29
|
def_delegator :zoned_date_time, :nano, :nsec
|
28
30
|
def_delegator :zoned_date_time, :to_epoch_second, :to_i
|
29
31
|
alias inspect to_s
|
32
|
+
alias day mday
|
30
33
|
|
31
34
|
java_import Java::OrgOpenhabCoreLibraryTypes::DateTimeType
|
32
35
|
java_import java.time.ZonedDateTime
|
@@ -181,6 +184,15 @@ module OpenHAB
|
|
181
184
|
utc_offset.zero?
|
182
185
|
end
|
183
186
|
|
187
|
+
#
|
188
|
+
# Returns an integer representing the day of the week, 0..6, with Sunday == 0.
|
189
|
+
#
|
190
|
+
# @return [Integer] The day of week
|
191
|
+
#
|
192
|
+
def wday
|
193
|
+
zoned_date_time.day_of_week.value % 7
|
194
|
+
end
|
195
|
+
|
184
196
|
#
|
185
197
|
# The timezone
|
186
198
|
#
|
data/lib/openhab/version.rb
CHANGED