Skip to content

Commit

Permalink
24.02.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Feb 14, 2024
1 parent 9d736fe commit e28dc09
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Packages required to build the documentation
sphinx == 7.2.6
sphinx-autodoc-typehints == 1.25.3
sphinx-autodoc-typehints == 2.0.0
sphinx_rtd_theme == 2.0.0
sphinx-exec-code == 0.12
autodoc_pydantic == 2.0.1
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ MyOpenhabRule()
```

# Changelog
#### 24.02.0 (2024-XX-XX)
#### 24.02.0 (2024-02-14)
- For openHAB >= 4.1 it's possible to wait for a minimum openHAB uptime before connecting (defaults to 60s)
- Renamed config entry mqtt.connection.client_id to identifier (backwards compatible)
- ``ItemTimeSeriesUpdatedEvent`` gets ignored
- Updated dependencies
- Updated docs

#### 24.01.0 (2024-01-08)
- Added HABApp.util.RateLimiter
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Packages for source formatting
# -----------------------------------------------------------------------------
pre-commit == 3.5.0 # 3.6.0 requires python >= 3.10
ruff == 0.1.15
ruff == 0.2.1

# -----------------------------------------------------------------------------
# Packages for other developement tasks
Expand Down
6 changes: 3 additions & 3 deletions requirements_setup.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
aiohttp == 3.9.3
pydantic == 2.6.0
pydantic == 2.6.1
msgspec == 0.18.6
bidict == 0.22.1
watchdog == 3.0.0
watchdog == 4.0.0
ujson == 5.9.0
aiomqtt == 2.0.0

Expand All @@ -13,7 +13,7 @@ pendulum == 2.1.2
stack_data == 0.6.3
colorama == 0.4.6

voluptuous == 0.14.1
voluptuous == 0.14.2

typing-extensions == 4.9.0

Expand Down
2 changes: 1 addition & 1 deletion src/HABApp/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# Development versions contain the DEV-COUNTER postfix:
# - 24.01.0.DEV-1

__version__ = '24.02.0.DEV-1'
__version__ = '24.02.0'
10 changes: 10 additions & 0 deletions src/HABApp/openhab/connection/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ class OpenhabContext:
session: aiohttp.ClientSession
session_options: dict[str, Any]

@classmethod
def new_context(cls, version: tuple[int, int, int],
session: aiohttp.ClientSession, session_options: dict[str, Any]):
return cls(
version=version, is_oh3=version < (4, 0), is_oh41=version >= (4, 1),
waited_for_openhab=False,
created_items={}, created_things={},
session=session, session_options=session_options,
)


CONTEXT_TYPE: TypeAlias = Optional[OpenhabContext]

Expand Down
8 changes: 2 additions & 6 deletions src/HABApp/openhab/connection/handler/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,8 @@ async def on_connecting(self, connection: OpenhabConnection):
if vers < (3, 3):
log.warning('HABApp requires at least openHAB version 3.3!')

connection.context = OpenhabContext(
version=vers, is_oh3=vers < (4, 0), is_oh41=vers >= (4, 1),
waited_for_openhab=False,
created_items={}, created_things={},
session=self.session, session_options=self.options,
)
connection.context = OpenhabContext.new_context(
version=vers, session=self.session, session_options=self.options)

# during startup we get OpenhabCredentialsInvalidError even though credentials are correct
except (OpenhabDisconnectedError, OpenhabCredentialsInvalidError):
Expand Down
7 changes: 1 addition & 6 deletions tests/test_openhab/test_plugins/test_load_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,8 @@ async def test_item_sync(monkeypatch, ir: ItemRegistry, test_logs):
monkeypatch.setattr(load_items_module, 'async_get_all_items_state', _mock_get_all_items_state)
monkeypatch.setattr(load_items_module, 'async_get_things', _mock_get_things)

context = OpenhabContext(
version=(1, 0, 0), is_oh3=False, is_oh41=False,
waited_for_openhab=False,
created_items={}, created_things={},
context = OpenhabContext.new_context(version=(1, 0, 0), session=None, session_options=None,)

session=None, session_options=None,
)
# initial item create
await LoadOpenhabItemsPlugin().on_connected(context)

Expand Down

0 comments on commit e28dc09

Please sign in to comment.