Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DEFAULT optional due to homegear support #1744

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Disable collector for stop events
- Improve logging when raising exception
- Log exception at the most outer service
- Make UPDATEABLE optional due to homegear support
- Make UPDATEABLE and DEFAULT optional due to homegear support
- Raise exception on set_value, put_paramset
- Remove command queue

Expand Down
2 changes: 1 addition & 1 deletion hahomematic/platforms/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, central: hmcu.CentralUnit, interface_id: str, device_address:
self._device_updated_callbacks: Final[list[Callable]] = []
self._firmware_update_callbacks: Final[list[Callable]] = []
self._model: Final = self._description["TYPE"]
self._is_updatable: Final = self._description.get("UPDATABLE", False)
self._is_updatable: Final = self._description.get("UPDATABLE") or False
self._rx_modes: Final = get_rx_modes(mode=self._description.get("RX_MODE", 0))
self._sub_model: Final = self._description.get("SUBTYPE")
self._ignore_for_custom_entity: Final[bool] = (
Expand Down
2 changes: 1 addition & 1 deletion hahomematic/platforms/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _assign_parameter_data(self, parameter_data: ParameterData) -> None:
)
self._max: ParameterT = self._convert_value(parameter_data["MAX"])
self._min: ParameterT = self._convert_value(parameter_data["MIN"])
self._default: ParameterT = self._convert_value(parameter_data["DEFAULT"])
self._default: ParameterT = self._convert_value(parameter_data.get("DEFAULT")) or self._min
flags: int = parameter_data["FLAGS"]
self._visible: bool = flags & Flag.VISIBLE == Flag.VISIBLE
self._service: bool = flags & Flag.SERVICE == Flag.SERVICE
Expand Down