Skip to content

Commit 94fe2e4

Browse files
committed
add getItems function
1 parent 97d38dc commit 94fe2e4

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ from openhab import Registry
500500
| getThings | Registry.getThings() | Array of [openHAB Things](https://www.openhab.org/javadoc/latest/org/openhab/core/thing/thing) |
501501
| getThing | Registry.getThing(uid) | [openHAB Thing](https://www.openhab.org/javadoc/latest/org/openhab/core/thing/thing) |
502502
| getChannel | Registry.getChannel(uid) | [openHAB Channel](https://www.openhab.org/javadoc/latest/org/openhab/core/thing/channel) |
503+
| getItems | Registry.getItems() | Array of [Item](#class-item) |
503504
| getItemState | Registry.getItemState(item_name, default = None) | [openHAB State](https://www.openhab.org/javadoc/latest/org/openhab/core/types/state) |
504505
| getItem | Registry.getItem(item_name) | [Item](#class-item) |
505506
| resolveItem | Registry.resolveItem(item_or_item_name) | [Item](#class-item) |

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "1.0.12" # version string is for backward compatibility with openhab 5.0.0
1+
__version__ = "1.0.13" # version string is for backward compatibility with openhab 5.0.0
22

33
from openhab.helper import rule, logger, Registry

src/helper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ def getChannel(uid: str) -> Java_Channel:
472472
raise builtins.__wrapException__(NotFoundException("Channel {} not found".format(uid)),2)
473473
return channel
474474

475+
@staticmethod
476+
def getItems() -> list[Item]:
477+
return scope.itemRegistry.getItems()
478+
475479
@staticmethod
476480
@_Tracing.javacall
477481
def getItemState(item_name: str, default: Java_PrimitiveType = None) -> Java_PrimitiveType:

0 commit comments

Comments
 (0)