v5.32.0 (2024-11-25)
- alias GenericItem#category to GenericItem#icon by @ccutrer in #350
- Add all state and command descriptions options to items builder by @ccutrer in #351
- Add NumberItem#range by @ccutrer in #352
- Add planckian helpers for HSBType by @ccutrer in #353
- support sitemap colortemperaturepicker by @ccutrer in #357
- special case mired unit dimension inference in items builder by @ccutrer in #349
- Fix logger error when no toplevel file is found by @jimtng in #348
- Use Units::MIRED instead of "mired" in HSBType by @jimtng in #360
- fix mired detection in OH 4.3 by @ccutrer in #359
- fix race condition when using semantic methods by @ccutrer in #356
Full Changelog: v5.31.0...v5.32.0
v5.31.0 (2024-10-03)
Full Changelog: v5.30.1...v5.31.0
v5.30.1 (2024-10-03)
Full Changelog: v5.30.0...v5.30.1
v5.30.0 (2024-10-02)
Full Changelog: v5.29.0...v5.30.0
v5.29.0 (2024-09-19)
- Add
#time_only?
and#offset
to TimerEvent by @jimtng in #333 - Add
#yesterday?
,#today?
, and#tomorrow?
to ZonedDateTime, Date, and Time classes. by @jimtng in #341 - Make working with Instant easier by @jimtng in #338
Full Changelog: v5.28.0...v5.29.0
v5.28.0 (2024-09-15)
- Allow literal states for sitemap visibility rules by @ccutrer in #335
- Move #items and #things to EntityLookup by @ccutrer in #336
Full Changelog: v5.27.2...v5.28.0
v5.27.2 (2024-09-11)
Full Changelog: v5.27.1...v5.27.2
v5.27.1 (2024-09-09)
- Make all providers notify their listeners when the script is unloaded by @jimtng in #330
- Make DateTimeType.parse use the local timezone when a time-only string doesn't specify a tz by @jimtng in #331
Full Changelog: v5.27.0...v5.27.1
v5.27.0 (2024-09-08)
- Support offset in
at
andevery :day, at:
triggers by @jimtng in #278 - Support space separator between date and time by @jimtng in #329
- DateTimeType implements Java's Comparable in openHAB 4.3 by @jimtng in #328
- Sitemap updates not propagated to listeners by @jimtng in #327
Full Changelog: v5.26.0...v5.27.0
v5.26.0 (2024-08-25)
Full Changelog: v5.25.0...v5.26.0
v5.25.0 (2024-08-20)
- Add
Thing#bridge?
by @jimtng in #324 - Support adding group members with
GroupItem.members.add
by @jimtng in #322
Full Changelog: v5.24.2...v5.25.0
v5.24.2 (2024-07-30)
Full Changelog: v5.24.1...v5.24.2
v5.24.1 (2024-07-26)
Full Changelog: v5.24.0...v5.24.1
v5.24.0 (2024-07-23)
Full Changelog: v5.23.0...v5.24.0
v5.23.0 (2024-07-22)
- Notification: support Image item as attachment by @jimtng in #315
- Support attachment for
every
with dynamic datetime trigger by @jimtng in #307 - TimeSeries: add
#<<
convenience method and refactor with LazyArray by @jimtng in #313 - TimedCommand: support resuming and rescheduling timed commands by @jimtng in #312
- Sitemaps: support Button widgets inside buttongrids by @jimtng in #272
- Support
every
trigger with multiple days of week. by @jimtng in #309
- Add
call_item?
predicate to GroupItem by @jimtng in #311 - Fix
every
day-of-week trigger by @jimtng in #308
Full Changelog: v5.22.1...v5.23.0
v5.22.1 (2024-07-06)
Full Changelog: v5.22.0...v5.22.1
v5.22.0 (2024-07-05)
- Persistence: support direct arithmetics against PersistedState by @jimtng in #288
- Add
StartlevelEvent
by @jimtng in #294 - Add
ItemChannelLinkAddedEvent
andItemChannelLinkRemoved
events by @jimtng in #293 - Persistence: support multiplication with PersistedState by @jimtng in #289
- Allow changed trigger on any Thing by @jimtng in #296
- NotificationAction: replace
notify
withNotification.send
, addNotification.hide
, support reference id. by @jimtng in #297 - Add TimedCommand parameter
only_when_ensured
by @jimtng in #290 - NotificationAction: add
Notification.log
to send log notifications by @jimtng in #299
Full Changelog: v5.21.0...v5.22.0
v5.21.0 (2024-06-28)
Full Changelog: v5.20.0...v5.21.0
v5.20.0 (2024-06-27)
- Sitemaps: support
release
option in switch mappings by @jimtng in #275 - Sitemaps: add
release_only
option forslider
by @jimtng in #274 - Persistence: add
last_change
andnext_change
by @jimtng in #277 - Add
CallItem
andStringListType
support by @jimtng in #283
- Sitemaps: fix slider's switch setting by @jimtng in #273
- Initializing a
DateTimeType
without an argument should set it to now by @jimtng in #280
Full Changelog: v5.19.1...v5.20.0
v5.19.1 (2024-05-21)
Full Changelog: v5.19.0...v5.19.1
v5.19.0 (2024-05-16)
- Support filtered item|thing_added|removed and channel_linked|unlinked triggers by @jimtng in #266
- Support changes in OH4.2 persistence by @jimtng in #244
- Add link management methods to channel by @ccutrer in #268
Full Changelog: v5.18.1...v5.19.0
v5.18.1 (2024-04-06)
Full Changelog: v5.18.0...v5.18.1
v5.18.0 (2024-03-05)
- Infer id for rules created from UI by @jimtng in #250
- Add a descriptive label to changed duration trigger by @jimtng in #254
- TimeSeries#add: accept a Ruby String or a Numeric value by @jimtng in #259
- Use lowercase in watch trigger label to be consistent with core by @jimtng in #255
- Update logger prefix if uid is set inside rule block by @jimtng in #252
- Rules Registry#remove should return nil on non-existent ruleuid by @jimtng in #251
- Tweak Rule ID inference to work with F7 router by @jimtng in #260
- Don't create rule with an explicit rule uid when it already exists by @jimtng in #253
Full Changelog: v5.17.0...v5.18.0
v5.17.0 (2024-01-30)
- Add description and tags to terse rules by @jimtng in #241
- Add NumericItem#nonzero? by @jimtng in #243
- Add support for TimeSeries by @jimtng in #236
- Add Thing#bridge convenience accessor by @ccutrer in #237
- Refactor item lookup to speed up item builder by @jimtng in #240
- Fix dummy items when using sitemap proxy builder by @jimtng in #245
Full Changelog: v5.16.0...v5.17.0
v5.16.0 (2024-01-10)
- Support selecting multiple types of location and equipment by @jimtng in #230
- Add support for icons in sitemap builder switch mappings by @jimtng in #232
Full Changelog: v5.15.1...v5.16.0
v5.15.1 (2024-01-06)
Full Changelog: v5.15.0...v5.15.1
v5.15.0 (2024-01-06)
- Add Enumerable#toggle to complement #on and #off by @jimtng in #226
- allow not using instance_exec with sitemap builder by @ccutrer in 227
Full Changelog: v5.14.0...v5.15.0
v5.14.0 (2024-01-05)
- Add more helper methods to access linked channels by @ccutrer in #215
- testing: add helper to initialize missing thing types by @ccutrer in #218
- testing: load storage based type providers by @ccutrer in #216
- ignore damaged bundle in rspec by @ccutrer in #217
- spec: "autoupdate" channels from mock thing handler by @ccutrer in #219
- Make sitemap label a kwarg by @jimtng in #220
- spec: change how mock timers hook in by @ccutrer in #221
Full Changelog: v5.13.0...v5.14.0
v5.13.0 (2024-01-04)
- Add tags and description to #script and #scene by @jimtng in #214
- Support staticIcon and dynamic icon in sitemap by @jimtng in #212
- Support Buttongrid in Sitemap Builder by @jimtng in #211
Full Changelog: v5.12.1...v5.13.0
v5.12.1 (2023-12-29)
- ensure ivar is initialized by @ccutrer in #205
- Fix Bridge Builder and allow nested Thing by @jimtng in #208
Full Changelog: v5.12.0...v5.12.1
v5.12.0 (2023-12-19)
- Support AND'd visibility and color rules in sitemap builder by @ccutrer in #200
- Avoid extra ensure state check from item helper commands by @ccutrer in #190
Full Changelog: v5.11.0...v5.12.0
v5.11.0 (2023-10-29)
- Allow configuring predefined channels in Thing builder #189 (jimtng)
- Infer accepted_item_type in ChannelBuilder #187 (jimtng)
v5.10.0 (2023-10-25)
- Add Item.link, Item.unlink, and Item.links.clear to add/remove a link to a channel #180 (jimtng)
- Add
event.group
fortriggeringGroup
#160 (jimtng)
- Fix ProfileCallback#handle_command when an item is linked to a different channel type #182 (jimtng)
- Warn when creating a tag that already exists #181 (jimtng)
v5.9.0 (2023-10-09)
- Support all attributes of channel builder #178 (jimtng)
- Refactor ChannelsArray lookup by channel id and uid #177 (jimtng)
- Inspect the full details of Channel attributes #176 (jimtng)
v5.8.0 (2023-10-07)
- Add Thing#provider #167 (ccutrer)
- Support removing custom semantic tags #162 (jimtng)
- Support expire configuration options in Item Builder #158 (jimtng)
- Allow updating things/items/sitemaps by recreating them #157 (jimtng)
- Allow symbolic channel name in ItemBuilder #156 (jimtng)
- Add UI script's uid to logger prefix #152 (jimtng)
- Metadata::Hash#provider shouldn't raise an exception #161
- Fix latitude/longitude/altitude getters on Location objects #174 (uqs)
- Semantics.add should raise an error if parent is invalid #168 (jimtng)
- Verify item builder's
dimension
#165 (jimtng) - Fix a non-array passed to item's
groups
argument inside group block #164 (jimtng) - Fix entity lookup inside item builder's item block #163 (jimtng)
v5.7.1 (2023-09-18)
- Stringify keys in http headers #150 (jimtng)
- Use block's source location as timer's log identifier #149 (jimtng)
v5.7.0 (2023-09-18)
v5.6.1 (2023-09-12)
- Fix defaults with cron fields
dow
anddom
#142 (jimtng) - Add unit conversion operator (|) to java.math.BigDecimal #140 (ccutrer)
v5.6.0 (2023-09-08)
- Add
thing
parameter for ItemBuilder #137 (jimtng) - Support providing and accessing context in rules #133 (jimtng)
- Add event attributes for TimerEvent #131 (jimtng)
- Use the default cron handler in openHAB 4 #128 (jimtng)
- Add group function #to_s and #inspect #127 (jimtng)
- add item type predicates #125 (ccutrer)
- Add SemanticTag#to_s #120 (jimtng)
- Don't tag
cron
,every
, andat
triggers with "Schedule" #111 (jimtng)
- Fix item builder's group COUNT function #126 (jimtng)
- Fix Semantics::Tag#to_s #121 (jimtng)
- Fix block passing in Hash#delete_if #116 (jimtng)
- Add timeout during karaf boot process waits #95 (ccutrer)
v5.5.0 (2023-08-08)
- backtrace_locations returns nil #102
- Fix changed duration without from or to #107 (jimtng)
- Fix loading a console session of your own openHAB instance #94 (ccutrer)
v5.4.2 (2023-07-23)
v5.4.0 (2023-06-14)
- Access scenes by uid #77
- Tag
cron
,every
, andat
triggers with "Schedule" #80 (ccutrer) - Add
scene
helper method to easily create rules tagged as Scene #78 (ccutrer)
v5.3.0 (2023-05-31)
- DSL methods override user's method on the top level #4
- Workaround unusual inheritance chain of
main
#74 (ccutrer)
v5.2.0 (2023-05-02)
- Fix duration trigger conditions for group member triggers #69 (ccutrer)
- Audio.play_sound called the wrong Java method #67 (jimtng)
v5.1.1 (2023-04-23)
- Avoid having to re-lookup Semantics::Property on every reference in 3.4.x #66 (ccutrer)
- Fix version detection against 4.0.0.M* #64 (ccutrer)
v5.1.0 (2023-04-19)
To use version 5.1 of the library, be sure to update the gems
setting in the JRubyScripting addon to >~ 5.1
. The default setting is ~> 5.0.0
which will not upgrade the version to 5.1.
v5.0.1 (2023-04-05)
- ItemStateUpdatedEvent added in openHAB 4 caused
updated
triggers to fail #49 (jimtng) - Audio.play_sound with volume calls the wrong java method #43 (jimtng)
- Handle Rules.manager being nil #40 (ccutrer)
5.0 is the first release as the officially supported gem of the openHAB organization. Many thanks to @boc-tothefuture, @ccutrer, @jimtng, and @pacive for their work on the previous versions. This major release contains significant restructuring by @ccutrer, with additional contributions by @jimtng. Here is a non-exhaustive list of significant departures from the original gem:
- Logging has been reworked. There's generally no need to
include OpenHAB::Log
in your classes. {OpenHAB::Log.logger} method now accepts a String to explicitly find whichever logger you would like, and {OpenHAB::Logger#level=} can be used to dynamically change the log level. Issues around the logger name while a rule is executing have also been resolved: the top-levellogger
will be named after the file, and thelogger
within arule
or execution block will be named after the rule. Loggers within class or instance-of-a-class context will be named after the class. These loggers will not have their name changed simply because their methods happened to be called while a rule is executing. Logging also defaults to#to_s
now, instead of#inspect
. - The documentation philosophy has changed. Instead of relying on a large set of markdown files to give both commentary and to document the details of objects, YARD is now the primary generator of the documentation site. Details of individual objects and methods are now documented inline with the code, reducing duplication, aiding in keeping them up-to-date and accurate, and being more rigorous in ensuring the documentation has every available method listed, and in a consistent manner. Some commentary and high level examples (such as this file) are still maintained as dedicated markdown files, but included in the YARD docs, instead of being a separate site that then links to the YARD docs.
- The testing philosophy has also changed. The rspec-openhab-scripting gem, previously written as an independent project by @ccutrer, has now been merged into this gem. There is a tight interdependence between the two, and especially during the large refactoring it's much easier to have them in the same repository. This means that that gem is now the endorsed method to write tests for end-user rules, as well as the preferred way to write tests for this gem itself, when possible.
- Major re-organization of class structures. {OpenHAB::Core} now contains any classes that are mostly wrappers or extensions of org.openhab.core Java classes, while {OpenHAB::DSL} contains novel Ruby-only classes that implement a Ruby-first manner of creating rules, items, and things.
- As part of the re-organization from above, the definition of a "DSL method"
that is publicly exposed and available for use has been greatly refined.
Top-level DSL methods are only available on
main
(the top-level {Object} instance when you're writing code in a rules file and not in any other classes), and inside of other select additional DSL constructs. If you've written your own classes that need access to DSL methods, you either need to explicitly call them on {OpenHAB::DSL}, or mix that module into your class yourself. Additional internal and Java constants and methods should no longer be leaking out of the gem's public API.
- Dropping support for openHAB < 3.4.
- The main require is now
require "openhab/dsl"
instead of justrequire "openhab"
. The reason being to avoid conflicts if a gem gets written to access openHAB via REST API. It's probably preferred that you configure automatic requires for this file anyway. - {GenericItem} and descendants can no longer be treated as the item's state. While convenient at times, it introduces many ambiguities on if the intention is to interact with the item or its state, and contortionist code attempting to support both use cases.
- {OpenHAB::Core::Types::Type Enum types} no longer have implicit conversions for comparisons.
This means you can no longer do
DimmerItem.state == ON
. Predicate methods retain the implicit conversion semantics, so you can doDimmerItem.on?
.ensure.on
, etc. also still retain their internal implicit comparisons, so you can also still doDimmerItem.ensure.on
and it will not send {ON} if the item is anything but0
. {OpenHAB::Core::Events::ItemStateEvent} and {OpenHAB::Core::Events::ItemStateChangedEvent} both now have a full set of predicate methods to ease use from within rule execution blocks. - Semi-related to the above two points, the
#truthy?
method has been removed from any items the previously implemented it. Instead, be more explicit on what you mean - for exampleItem.on?
. If you would like to use a similar structure with {StringItem StringItems}, just include the ActiveSupport gem in your rules to get#blank?
and#present?
methods, and then you can useItem.state.present?
. - Semi-related to the above, the
{OpenHAB::DSL::Rules::BuilderDSL#only_if only_if} and
{OpenHAB::DSL::Rules::BuilderDSL#not_if not_if} guards now only take blocks.
This just means where you previously had
only_if Item
you now writeonly_if { Item.on? }
. - Related to the above, {OpenHAB::DSL::Rules::BuilderDSL#changed changed for:}
guards no longer take items. This just means if you previously had
changed Item, for: OtherItem
you now writechanged Item, for: -> { OtherItem.state }
. - {QuantityType} is no longer implicitly
convertible and comparable against Strings. Use the
|
operator for easy construction of {QuantityType}s:10 | "°F"
. - {HSBType} is no longer convertible and comparable against Strings, Hashes, and Arrays. Just construct an HSBType. Sending a HTML hex color as a string as a command is still supported.
- {PointType} is no longer convertible and comparable against Strings and Hashes. Just construct a PointType. Send strings as a command is still supported.
- {QuantityType} can no longer be compared against
Numeric
or {DecimalType} outside a {OpenHAB::DSL.unit unit} block. Either compare it against another QuantityType, or convert it with to_f first, perform the comparison inside a {OpenHAB::DSL.unit unit} block, or {OpenHAB::DSL.unit! permanently set} your preferred units. - The top-level
groups
method providing access to only {GroupItem}s has been removed. Useitems.grep(GroupItem)
if you would like to filter to only groups. GenericItem#id
no longer exists; just use {Item#to_s Item#to_s} which does what#id
used to do.states?(*items)
helper is gone. Just useitems.all?(:state?)
, or in the rare cased you usedstates?(*items, things: true)
, useitems.all? { |i| i.state? && i.things.all?(&:online?) }
.- {GroupItem} is no longer {Enumerable}, and you must use {GroupItem#members GroupItem#members}.
- {GroupItem#all_members GroupItem#all_members} no
longer has a
filter
parameter; usegrep
if you want just {GroupItem}s. create_timer
no longer exists as an alias for {after}.Item#meta
is no longer a supported alias for {Item#metadata Item#metadata}.- Triggers (such as {OpenHAB::DSL::Rules::BuilderDSL#changed changed},
{OpenHAB::DSL::Rules::BuilderDSL#updated updated}, and
{OpenHAB::DSL::Rules::BuilderDSL#received_command received_command} that
previously took a splat or an Array of Items now only take a splat.
This just means instead of
changed [Item1, Item2]
you writechanged Item1, Item2
, or if you have an actual array you writechanged(*item_array)
. This greatly simplifies the internal code that has to distinguish between {GroupItem::Members GroupItem::Members} and other types of collections of items. - Date and time objects have been reworked:
TimeOfDay
has been replaced with {LocalTime}- Date/time objects are no longer comparable to strings. Please use the correct type.
- Comparisons among the varying date/time classes all work.
- See also Working With Time
- Persistence methods no longer accept a {Duration}. Please use
Duration#ago
instead.
- Thing actions are no longer available as a top level method. You must use the {OpenHAB::Core::Things::Thing#actions Thing} object.
- Thing actions whose scope does not match the thing's binding are no longer directly available on {OpenHAB::Core::Things::Thing Thing}; you must explicitly access them via {OpenHAB::Core::Things::Thing#actions Thing#actions}.
- {OpenHAB::Core::Items::Persistence Persistence} predicates are no longer
aliased without the
?
(i.e. you must call#changed_since?
, not#changed_since
). - Timers with IDs are no longer uniqueified by where they were created. Make
sure you're using a completely unique timer ID if you're using them in
multiple locations. For example,
after(1.minute, id: [:this_logical_usage, event.item])
. This makes it possible to schedule the same logically re-entrant timer from multiple rules. OpenHAB.conf_root
was renamed to {OpenHAB::Core.config_folder}.- {OpenHAB::Core::Items::GenericItem#metadata Metadata} now defaults to using transient backing provider. This means that if you add metadata to an item from Ruby, it will disappear when the script is unloaded. See {OpenHAB::DSL.provider} for how to revert to the old behavior within a single block, or for your entire script.
- {OpenHAB::Core::Items::GenericItem#metadata Metadata} will now be serialized before being set. This fixes a complicated issue where types would changed unexpectedly, or even worse, reference Ruby classes that are not even available in the current JRuby instance. See openhab/openhab-core#3169 for more details.
#on_start
trigger was renamed to {OpenHAB::DSL::Rules::BuilderDSL#on_load #on_load} and its 'run_on_start' parameter removed. {OpenHAB::DSL::Rules::BuilderDSL#on_start #on_start} is now a trigger forcore.SystemStartlevelTrigger
.say
,play_sound
, andplay_stream
are no longer available at the top level. You must access them from their Action class: {OpenHAB::Core::Actions::Voice.say Voice.say}, {OpenHAB::Core::Actions::Audio.play_sound Audio.play_sound}, and {OpenHAB::Core::Actions::Audio.play_stream Audio.play_stream}
- {OpenHAB::DSL::Items::Builder}
- {OpenHAB::DSL::Things::Builder}
- {group::OpenHAB::DSL::Rules::BuilderDSL::Triggers Several new triggers}
- {OpenHAB::DSL.profile}
- {OpenHAB::DSL.script}
- {OpenHAB::DSL.shared_cache}
- {OpenHAB::Core::Rules::Registry}, specifically {OpenHAB::Core::Rules::Registry#remove #remove} and {OpenHAB::Core::Rules::Rule#trigger #trigger} are new functionality.
- {OpenHAB::DSL.unit} can now handle units for multiple dimensions.
- Support Ruby's method name convention for thing actions, e.g.
things["mqtt:broker:mosquitto"].publish_mqtt
- {OpenHAB::DSL.timers timers} now returns {OpenHAB::DSL::TimerManager an object} that can be used to thread-safely schedule/reschedule/cancel timers by ID.
#inspect
on several classes has been improved to be useful, instead of just returning the class name.- {OpenHAB::DSL.after after} (and anything else that ultimately relies on timers) support
Proc
for durations. - Add
#ago
and#from_now
methods to {Duration}. - The ability to designate how metadata should be persisted or not, via {OpenHAB::DSL.provider}.
- {java.util.Map} and {java.util.List} now more fully implement the expected interfaces of
Hash
andArray
, so you don't need to explicitly convert (as much) anymore. - If you reference an item that does not currently exist in a rule trigger, instead of raising
MethodMissing
orNameError
, the trigger will be created anyway. openHAB will log a warning that the item is missing, and the trigger will not work. When the item is eventually created, the trigger will begin to work. This matches the behavior of DSL rules. Note that this only works for {OpenHAB::DSL::Rules::Terse terse rules} if they're created within a {OpenHAB::DSL::Rules::Builder rules.build} block. - {OpenHAB::DSL::Rules::BuilderDSL#on_start #on_start} supports creating a
core.SystemStartlevelTrigger
. Also see {OpenHAB::DSL::Rules::BuilderDSL#on_load #on_load}. - {OpenHAB::DSL::Rules::BuilderDSL#on_load #on_load} supports delay
- Various Ephemeris methods on {ZonedDateTime}.
- {OpenHAB::DSL::Rules::BuilderDSL#dependencies} Rule dependencies
- A set of debounce/throttle guards for file-based rules: {OpenHAB::DSL::Rules::BuilderDSL#debounce_for debounce_for}, {OpenHAB::DSL::Rules::BuilderDSL#throttle_for throttle_for}, and {OpenHAB::DSL::Rules::BuilderDSL#only_every only_every}
- And for UI rules: {OpenHAB::DSL.debounce_for debounce_for}, {OpenHAB::DSL.throttle_for throttle_for}, {OpenHAB::DSL.only_every only_every}
- Explicitly document modifying item tags, labels and categories (where possible), and notify openHAB of the change
- {OpenHAB::Core::Events::ItemStateEvent} and {OpenHAB::Core::Events::ItemStateChangedEvent} now have full sets of predicate methods.
- {OpenHAB::DSL::Rules::Terse terse rules} now have an
on_load
parameter. - {Item#all_groups Item#all_groups}, {Enumerable#all_members}, {Enumerable#groups}, {Enumerable#all_groups}.
- {GenericItem#formatted_state GenericItem#formatted_state}.
- {OpenHAB::DSL.transform} now available at top-level, like Rules DSL.
- {Item#member_of? Item#member_of?}, {Item#tagged? Item#tagged?}.
- {OpenHAB::DSL::Rules::BuilderDSL.watch watch} can now be used to monitor subdirectories
- Fix thing {OpenHAB::Core::EntityLookup#method_missing entity lookup}
- Fix {OpenHAB::DSL::Items::Ensure ensure} to work with {QuantityType}
- Fix scoping of {OpenHAB::DSL::Rules::Terse terse rule} blocks
- {OpenHAB::DSL.persistence persistence block} now restores the previous setting
- {OpenHAB::DSL.unit unit} block applies to sending commands to {NumberItem NumberItems}.
- All thread locals are carried over to rule executions and timers. This includes {OpenHAB::DSL.unit unit}, {OpenHAB::DSL.persistence persistence}, and {OpenHAB::DSL.ensure_states ensure_states}.
- Fix thread safety issue that could cause timers to not be canceled when the script unloads.
- {OpenHAB::DSL::Items::TimedCommand#command Timed command} thread safety issues resolved
- {OpenHAB::DSL::Items::TimedCommand#command Timed command} now resets the on_expire setting when called again
- {OpenHAB::DSL::Items::TimedCommand#command Timed command} still sends the command even the previous timed command is still pending
- {OpenHAB::DSL::Items::TimedCommand#command Timed command} works with resetting to {NULL}/{UNDEF}
- {OpenHAB::DSL::Items::TimedCommand#command Timed command} works on items with autoupdate=false
- {OpenHAB::Core::Items::Metadata} hashes are indifferent (converts symbol keys to string keys).
- Fix {OpenHAB::DSL::Items::Ensure ensure} to work with conversions-from-string that are handled by openhab-core.
- Avoid stack overflow issues when all of ActiveSupport is required.
- Don't swallow exceptions inside of
rule
blocks - just let them propagate up. - Fix changed duration when only the
from
state is given - Updating an item with
nil
sets it toNULL
, not an empty string (which will be ignored by other item types).
4.45.2 (2022-10-02)
- items: ensure enumerable methods from
items
use ItemProxy (a149f96) - logging: use the class name for class loggers (e87e03b)
4.45.1 (2022-09-21)
- update openhab source url to github (792015e)
4.45.0 (2022-09-18)
- time: support arithmetic and comparison operators (e3466db)
- time_of_day: support a range of LocalTime for TimeOfDay#between? (fd12e3d)
- clean up ordering in Misc section (a6a0beb)
4.44.2 (2022-09-06)
- cron: fix clean up of cron handler (4190255)
- items: ensure items coming from group members are wrapped in ItemProxy (19bd416)
4.44.1 (2022-08-20)
- ruby: fix error with jruby 9.3.7 (82dced4)
4.44.0 (2022-07-31)
- standardize on java format for java class references (ae519bf)
- change the default openhab version to 3.3.0 (1fb42d0)
4.43.3 (2022-07-25)
4.43.2 (2022-07-25)
- rubocop: explicitly allow openhab globals (2baf772)
4.43.1 (2022-07-18)
- ensure: with QuantityType and plain number (83036b8)
- terse: improve automatic naming of terse rules (9683845)
- ui: attach rule source to rule (940780f)
- ui: improve rule UIDs (f41f5c5)
4.43.0 (2022-07-11)
- add play_stream action method (f3ab3ae)
- make the code base compatible with JRuby 9.4 (Ruby 3.x) (77cae44)
- ruby: fix another minor ruby warnings (77899c9)
- generic_trigger: config kwargs is not a hash in Ruby 3.x (528994a)
- persistence: change top-level class variable to instance var (95babba)
- update test matrix to openhab 3.3 (c9e8f1c)
- atomic_rule_write: create temp file in userdata/tmp (1cfec6b)
4.42.2 (2022-06-29)
4.42.1 (2022-06-20)
- persistence: between called the wrong method (f6b4b7a)
- upgrade test to 3.3.0.M7 (128e132)
4.42.0 (2022-06-18)
- add support for persistence 'between' methods (fc46fc4)
- add an example for DateTimeTrigger (279b81a)
- add --no-heap-dump to dev:dump-create (228710c)
- close file handle in truncate_log (359ae07)
- include more commit types in the changelog (2002afb)
- update build to use openhab 3.3.0M5 (46b9f32)
- use a simpler setup-ruby action (8187e77)
- use index in log dump file in github action (01e683a)
- ci: optimize CI builds by splitting features across number of runners (ed85b4d)
- ensure_states: change logging from trace to info (7686d32)
- rule_language: [@log_level_changed was missing (fe61b04)
4.41.0 (2022-04-28)
- comparing non null vs null comparable-item objects raised an exception (2844d7a)
- logging: change logger level predicate method names (a7305d3)
- semantics: rename sublocations to locations (f2dfd29)
4.40.0 (2022-04-24)
- grep: support grepping items from enumerable (ef29edd)
- item_equality: add the ability to compare item objects (0f4608b)
4.39.1 (2022-04-24)
- semantics: groupitem.points failed to return its siblings (afbec5e)
- semantics: revert the members search for enumerable#points (4e62458)
4.39.0 (2022-04-20)
- ensure: ensure didn't work on Enumerable (5cfe07b)
- enumerable: add Enumerable#members (e093bed)
- semantics: incorporate flat_map into Enumerable#points (a74194b)
4.38.0 (2022-04-15)
4.37.1 (2022-04-09)
- numeric_item: make NumericItem#| raise NoMethodError when state is nil (ac289fc)
4.37.0 (2022-04-08)
- zoneddatetime: make ZonedDateTime available on OpenHAB 3.2 (c22be74)
- conf: rename
__conf__
toOpenHAB.conf_root
(ea0a657) - timers[]: add #reschedule, rename #cancel_all to #cancel (38da4a0)
4.36.0 (2022-04-03)
- add support for timer and persistence to accept zoneddatetime and rubytime (640cf0e)
4.35.0 (2022-03-29)
- state: add state? helper method (e8bb65e)
4.34.1 (2022-03-16)
4.34.0 (2022-03-15)
- cron: support fields for cron and monthday object for every (0e53986)
4.33.1 (2022-03-10)
4.33.0 (2022-03-09)
- build: specify the local theme for jekyll (d9a3be3)
- ensure: implement ensure.update (c519b8b)
- timer: remove timer class from top-level (4c22e5a)
- timer: add create_timer as an alias for after (3753304)
4.32.7 (2022-03-07)
- dsl: dsl methods leaked into other objects (3d17030)
4.32.6 (2022-03-04)
- timed_command: timed command cancelled by its own command (075e627)
4.32.5 (2022-02-28)
- logger: exclude <script> in log prefix (ddb7104)
- rule: rule method returns the created rule (afe7f69)
4.32.4 (2022-02-27)
4.32.3 (2022-02-24)
- script_thing_actions: adapt to changes in openhab 3.3 (41cbb55)
4.32.2 (2022-02-22)
- logger: move logger class into core module to prevent unintentional modification (1ab681f)
4.32.1 (2022-02-21)
- color_item: move to_h and to_a from color_item into hsb_type (b00bbe7)
- hsbtype: comparison against another hsbtype only checks for brightness (2cebe9e)
4.32.0 (2022-01-23)
- command: received_command supports ranges and procs (ab3d974)
4.31.0 (2022-01-22)
- triggers: support quantity string range in trigger conditions (531ed23)
4.30.5 (2022-01-21)
- string_type: direct regex comparison and inspect (1703aa2)
4.30.4 (2022-01-21)
4.30.3 (2022-01-20)
- persistence: npe on dimensioned item without an explicit unit (251f625)
4.30.2 (2022-01-20)
- logger: incorrect logger prefix on non standard gem_home path (a3d9677)
4.30.1 (2022-01-19)
- types: fix already initialized warning on openhab 3.2.0 (188f2b0)
4.30.0 (2022-01-18)
- conditions: support procs/lambdas for trigger conditions (0f0bd16)
4.29.0 (2022-01-17)
- rules: support ranges as rule conditions (8cd6901)
4.28.2 (2022-01-17)
4.28.1 (2022-01-15)
- exception_handling: fix java exception handling (3539136)
- java_class: fix java to ruby class (7f4b0bc)
4.28.0 (2022-01-14)
- timer: add timers[id].cancel_all shorthand for timers[id].each(&:cancel) (d820471)
4.27.1 (2022-01-10)
- ensure: faulty ensure on boolean commands (623a08e)
- item_groups: fix Item#groups returning nil sometimes (20ae855)
4.27.0 (2022-01-06)
- item: support reloading of references items (64059cc)
4.26.4 (2022-01-06)
- monthday: fix monthday error when rolling over to another year (2bf6aa9)
4.26.3 (2022-01-02)
- test: instead of sleep, wait for for persistence feature to be installed (a926d73)
4.26.2 (2021-12-31)
- open_closed_type: state not inverted with ! operator (498b515)
4.26.1 (2021-12-29)
- docs: fix link to Yard docs (7ca4bce)
4.26.0 (2021-12-26)
- guard: execute guard in main context (b1f1fe0)
- watch: add trigger for file/directory watching (ed6352a)
4.25.0 (2021-12-21)
- month_day: support keyword arguments to create monthday (50f0f05)
4.24.1 (2021-12-14)
- timer_manager: timers[nonexistent_id] should return nil (550d9e0)
4.24.0 (2021-12-05)
- location: support hashes for locations (ae8ff6a)
4.23.0 (2021-12-05)
- monthday: fix equality comparison against string and allow parsing single digit month-days (a9d8b47)
- hsb: add from/to hash support (91876d0)
4.22.2 (2021-12-04)
- timed_command: fix race condition for timed commands (6f3edd3)
4.22.1 (2021-12-04)
- hsb: fix type in from_hsb (9ebe0f2)
4.22.0 (2021-12-03)
- datetime: support ZonedDateTime objects as commands for DateTime items (72287c1)
4.21.0 (2021-12-02)
- logging: log rule name or file name with log entries (a003904)
- attach: support attachments on cron triggers (70ef1dc)
4.20.0 (2021-12-01)
- rule: rule return value caused namespace errors (22fea0b)
- timers: support passing custom objects as timer duration (0fb0bcf)
4.19.1 (2021-12-01)
- includes: remove redundant includes (23376c4)
4.19.0 (2021-12-01)
- comparisons: === should perform an exact type match for case statements (3311e26)
- channel_trigger: allow setting channel triggers directly from thing/channel objects (9d99ee6)
- uid: make working with UIDs easier (string comparisons) (5a89ac8)
4.18.0 (2021-11-30)
- switch: accept boolean values (605949c)
4.17.0 (2021-11-30)
- trigger: create multiple delayed triggers for array from/to states (70d3b4a)
- things: easy access to channels from things, and items from channels (813bc5d)
4.16.0 (2021-11-30)
- item: add linked_thing and all_linked_things to items (5a640c6)
- linked_thing: alias thing/things to linked_thing/all_linked_things (9898b8a), closes #427
- things: add ability to lookup thing using ThingUID to things[] (9650698)
4.15.1 (2021-11-24)
- rule: rule method should return the rule object (239403f)
4.15.0 (2021-11-24)
- guard: include attachment in guards' event (61f387c)
- trigger: support creating triggers for any trigger type (6a90d43)
4.14.2 (2021-11-22)
- comparisons: fix comparison errors between two types (d694bc8)
4.14.1 (2021-11-20)
- timer: remove redundant delegators (932e82b)
4.14.0 (2021-11-14)
- script_handling: add tests (70008fc)
4.13.5 (2021-11-14)
- script_handling: scriptLoaded and scriptUnloaded not executed (4082280)
4.13.4 (2021-11-10)
- actions: call to_s to accept item as an argument (9f770b3)
- dev: add mac M1 platform to Gemfile.lock (76fdbfd)
4.13.3 (2021-11-08)
- binding: move gem home default and mkdirs (a9ccf3f)
4.13.2 (2021-11-08)
- binding: fix binding support for gem ugprades (07a1668)
4.13.1 (2021-11-07)
- month_day: test between guards with Time instead of TimeOfDay (65bf3b1)
4.13.0 (2021-11-06)
- test: test against jruby plugin that fixes 3.2M2 reload bug (bb98cb0)
4.12.1 (2021-11-06)
- dev: target ruby 2.6 (cdd3ea1)
- quantity: fix comparison between integer on left and quantity on right (b7f7531), closes #352
4.12.0 (2021-11-06)
- build: test against jruby 9.3 (690699d)
4.11.2 (2021-11-06)
- metadata: return ruby hash inside metadata enumerator (4347aa9)
4.11.1 (2021-11-06)
- reentrant_timer: reset the timer duration to the latest call (e8e8b66)
4.11.0 (2021-11-05)
- between: support for month-day ranges (f059c59)
4.10.3 (2021-11-04)
- timer: check the argument to reschedule (d1e895f)
4.10.2 (2021-11-03)
- test: added test coverage for mixed type between guards (9030b3f)
4.10.1 (2021-11-02)
4.10.0 (2021-11-02)
- attachments: adds attachments to triggers (88d35c5)
4.9.0 (2021-11-01)
- guards: guards only_if/not_if support arrays of items (66cda53)
4.8.5 (2021-11-01)
- guard: only_if/not_if should work on all item types (1c717a8)
4.8.4 (2021-11-01)
4.8.3 (2021-10-31)
- triggers: trigger methods return the trigger objects (463a928)
4.8.2 (2021-10-30)
- guards: log exception and stack traces encountered when guard procs are executed (68c5f4d)
4.8.1 (2021-10-30)
- hsb: fully qualify units class (25196d5)
4.8.0 (2021-10-29)
- timer: supports reentrant timers and timed commands for items (08d8f16)
4.7.1 (2021-10-29)
- hsb: convert csv strings to hsb value (5aad833)
4.7.0 (2021-10-27)
- changed: changed trigger now supports multiple from values (20bb64e)
- logging: use the class name not "Class" for class-level loggers (05b6217)
- metadata: allow assignment to existing metadata config (02df58a)
4.6.2 (2021-10-24)
- number_item: return false for number predicate methods when NULL (f147277)
4.6.1 (2021-10-24)
- timer: cancel timers in a rule when rule is unloaded (901a63e)
4.6.0 (2021-10-20)
- quantity: fix constructing quantity from numeric with | within rule (42dbafb), closes #319
- tests: fix ensure_states tests fragility (7a36c43), closes #304
4.5.0 (2021-10-19)
4.4.0 (2021-10-19)
- actions: fix say and play_media actions for PercentType change (53d7e06), closes #298
- docs: added docs for ensure/ensure_state (77904b1)
4.3.0 (2021-10-19)
- rules: add terse rule syntax for simple rules (1c4b774)
4.2.0 (2021-10-18)
- types: allow comparison and arithmetic directly against state types (22e237f)
4.1.4 (2021-10-11)
- dev: add binstubs for yard (e2f8053)
- dev: don't generate documentation when installing gem for tests (995b8fc)
4.1.3 (2021-10-10)
- docs: update installation docs to reference version 4.x of the gem (c486cad)
4.1.2 (2021-10-08)
4.1.1 (2021-10-07)
- dev: update gemfile and binstubs for use with MRI (7fe0027)
4.1.0 (2021-10-06)
- decimal_type: zero?, positive?, negative? predicates directly on DecimalType (bd69a76)
4.0.1 (2021-10-05)
- things, items: improves performance on array accessors '[]' (24bb04b)
4.0.0 (2021-10-05)
-
command: add predicate methods for named commands (a347bb5)
-
group_item: alias items to members (8e91ffc)
-
states: add predicate methods to several states (5f987cc), closes #237
-
types: ensure (almost) all command types are inspectable (2073072)
-
feat(events)!: wrap event.state same as item.state (cbe6e5c)
- event.state returns nil it's NULL or UNDEF.
- event.last renamed to event.was (the predicate methods make much more sense calling it was instead of last, similar to Rail's tracking of changed attributes).
- event.was returns nil if's NULL or UNDEF
3.9.4 (2021-09-25)
- build: have release process keep Gemfile.lock up to date (178cf4d)
3.9.3 (2021-09-25)
3.9.2 (2021-09-25)
- dev: ignore lockfile for file named gems.rb (8e31e0d)
- release: pin npm release versions to prevent build failures on upgrade of semantec release (e1dc2a3)
3.9.1 (2021-09-17)
- tests: speed up tests by avoiding unnecessary work (64c759c)
- tests: speed up tests by forcing openhab to find rules (d05a9e5)
3.9.0 (2021-09-17)
- load_path: apply $RUBYLIB (29b6a34)
3.8.3 (2021-09-16)
- docs: make shields in readme actual links (962eec7)
3.8.2 (2021-09-15)
- dev: add binstubs (a425401)
3.8.1 (2021-09-15)
- build: commit the Gemfile.lock (17def5c)
3.8.0 (2021-09-15)
3.7.4 (2021-09-15)
- test: test against released version of openhab 3.1 and set default to 3.1 (b8d09c1)
3.7.3 (2021-09-15)
- build: updated to new version of jruby scripting (ae8b5a2)
3.7.2 (2021-09-14)
- docs: remove duplicated "compare" in a few places (2a9af7b)
3.7.1 (2021-09-14)
- test: fix rubocop violations against newest rubocop (e8b859b)
3.7.0 (2021-06-04)
- quantity: implement positive?, negative?, and zero? for quantity and dimensioned numberitem (0d2c43c)
3.6.4 (2021-06-04)
- items: decorated items could not be used as hash keys (a4ff086)
3.6.3 (2021-06-03)
- improve reliability of some tests (22bc48e)
3.6.2 (2021-06-02)
- items: format BigDecimal state as a string the parser accepts (c752711)
3.6.1 (2021-06-02)
3.6.0 (2021-06-01)
- build: support testing of multiple versions of openhab (600bc88)
3.5.0 (2021-06-01)
- store_states: error when given a decorated item (ae7e1bc)
- add oh_item to item wrappers through def_item_delegator (079314f)
3.4.3 (2021-05-20)
- build: updated version of OpenHab (ef1b792)
3.4.2 (2021-04-02)
- metadata: convert loaded metadata config into Ruby objects (aa8e2b7)
3.4.1 (2021-04-02)
- dependency: swapped mimemagic for marcel for mime type detection (b1ec891)
3.4.0 (2021-03-22)
- thing: add boolean methods for checking thing's status (58bda12)
3.3.0 (2021-03-16)
- persistence: convert HistoricItem methods to directly return its state (942d7ea)
3.2.1 (2021-03-11)
- handle native java exceptions in clean_backtrace (a6f7be4)
3.2.0 (2021-03-10)
- support more comparisons (3898d2d)
3.1.2 (2021-03-09)
- scope: change execution block binding to be object that based a block to rule (b529684)
3.1.1 (2021-03-08)
- rollershutter_item: add safe navigation and nil checks (1e98464)
3.1.0 (2021-03-08)
- image: support for image items (dacc7a8)
3.0.1 (2021-03-03)
- triggering on multiple items caused a stack overflow (a1fac1d)
3.0.0 (2021-03-02)
- groups: groups now act as items (210e507)
- groups:
items
no longer acts as a indicator to rules to trigger on member changes, it has been replaced withmembers
2.27.1 (2021-03-02)
2.27.0 (2021-03-02)
- player: add support for player items (70418ab)
2.26.1 (2021-03-02)
- logging: use block syntax to log method calls (9657e72)
2.26.0 (2021-03-02)
- add stack trace to errors (572114e)
2.25.2 (2021-02-28)
- datetime: delegate more methods directly to ZonedDateTime (ea31954)
2.25.1 (2021-02-28)
2.25.0 (2021-02-24)
- groups: support command and << (dd140aa)
2.24.0 (2021-02-23)
- groups: adds supports for item groups (127ab17)
2.23.3 (2021-02-21)
- persistence: selective conversion to Quantity (3187de7)
2.23.2 (2021-02-21)
2.23.1 (2021-02-20)
2.23.0 (2021-02-20)
- metadata: convert value to string before assignment (dba5db7)
- event: add event.state for update trigger (d4eb4f7)
2.22.1 (2021-02-20)
- changed: for parameter with thing chaged trigger (cd08922)
2.22.0 (2021-02-19)
- add conversion operator for DecimalType to Quantity (42bc5de)
2.21.0 (2021-02-18)
- persistence: automatically convert to quantity for dimensioned items (7e352d4)
2.20.3 (2021-02-18)
- changed_duration: stringitem from/to comparison didn't work (21721e7)
2.20.2 (2021-02-18)
2.20.1 (2021-02-18)
- items: to_s did not include UNDEF and NULL (71f3de4)
2.20.0 (2021-02-18)
- add dig-method to top level metadata (2975cd5)
2.19.3 (2021-02-18)
- rule: otherwise blocks are always executed (dd5d5e5)
2.19.2 (2021-02-16)
- changed_duration: guards not evaluated for changed duration (48a63e8)
2.19.1 (2021-02-15)
- changed_duration: cancel 'changed for' timer correctly (1bf4aa3)
2.19.0 (2021-02-15)
- add RollershutterItem (f5801d9)
2.18.0 (2021-02-14)
- add DateTime Item type (a3cc139)
2.17.0 (2021-02-12)
- units: import OpenHAB common units for UoM (351a776)
2.16.4 (2021-02-12)
- changed_duration: timer reschedule duration bug (6bc8862)
2.16.3 (2021-02-12)
2.16.2 (2021-02-11)
- decorate items[itemname], event.item, and triggered item (ce4ef03)
2.16.1 (2021-02-11)
- timeofdayrangeelement: subclass Numeric to make comparisons more efficient (c2482e8)
2.16.0 (2021-02-10)
- support comparisons between various numeric item/state types (510d6db)
2.15.0 (2021-02-09)
- add Persistence support (9cab1ff)
2.14.3 (2021-02-09)
- multiple delayed triggers overwrite the previous triggers (6f14429)
2.14.2 (2021-02-08)
2.14.1 (2021-02-05)
- number_item: make math operations and comparisons work with Floats (3b29aa9)
2.14.0 (2021-02-03)
- logging: append rule name to logging class if logging within rule context (00c73a9)
2.13.1 (2021-02-02)
2.13.0 (2021-02-02)
- dimmeritem: dimmeritems can now be compared (aa286dc)
2.12.0 (2021-02-02)
- return nil for items['nonexistent'] instead of raising an exception (4a412f8)
- add Item.include? to check for item's existence (1a8fd3a)
2.11.1 (2021-02-01)
- group: support for accessing triggering item in group updates (6204f0a)
2.11.0 (2021-02-01)
- Add Duration.to_s (b5b9c81)
- Library now released as a Ruby Gem
- Support OpenHAB Actions
- Fixed StringItem comparison against a string
- Support for accessing item metadata namespace, value, and configuration
- SwitchItem.toggle to toggle a SwitchItem similar to SwitchItem << !SwitchItem
- Race condition with
after
block - Unknown constant error in certain cases uses
between
blocks
TimeOfDay.between?
to check if TimeOfDay object is between supplied range
- Reference in rules to TimeOfDay::ALL_DAY
- Corrected time of day parsing to be case insensitive
- Merge conflict
between
can be used throughout rules systems
- TimeOfDay parsing now supports AM/PM
- Support to allow comparison of TimeOfDay objects against strings
- Support for storing and restoring Item states
- Support for rule description
!
operator on SwitchItems now returns ON if item is UNDEF or NULL
- Support for thing triggers in rules
- Updated docs to point to OpenHAB document for script locations
- Timer delegate for 'active?', 'running?', 'terminated?'
- Logging of mod and/or inputs can cause an exception of they are nil
- Timers (after) now available inside of rules
- DSL imports now shared by OpenHAB module and Rules Module
- Timer delegate for
after
method that supports reschedule
- Breaking:
after
now returns a ruby Timer delegate
- Added support for channels triggers to rules
- Fixed documentation for changed/updated/receive_command options
- Breaking: Changed commanded method for rules to received_command
- Ability to execute rules based on commands sent to items, groups and group members
- Ability to send updates from item objects
- Fixed documentation for comparing dimensioned items against strings
- Support for item updates within rules languages
- Installation instructions to specify using latest release rather than a specific version
- Initial release