From 7ef33f23a2e2d8ef2e620a927755379621129c0d Mon Sep 17 00:00:00 2001 From: Jevgeni Kiski Date: Thu, 18 Apr 2024 20:12:14 +0300 Subject: [PATCH 1/6] 3.4.2-dev --- paradox/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paradox/__init__.py b/paradox/__init__.py index 17c5c3c..524935c 100644 --- a/paradox/__init__.py +++ b/paradox/__init__.py @@ -1,3 +1,3 @@ -VERSION = "3.4.1" +VERSION = "3.4.2-dev" __version__ = VERSION From 2220bcf21d644de70cf281d4dc66531c8d4d0f98 Mon Sep 17 00:00:00 2001 From: Jevgeni Kiski Date: Thu, 18 Apr 2024 20:56:21 +0300 Subject: [PATCH 2/6] Try to use Docker meta action --- .github/workflows/dev.yml | 4 +--- .github/workflows/master.yml | 9 --------- .github/workflows/publish_docker.yml | 20 ++++++++++++++------ .github/workflows/release.yml | 2 -- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8e4f5ce..d37c72b 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -16,8 +16,6 @@ jobs: name: Publish to Docker Hub uses: ./.github/workflows/publish_docker.yml needs: test - with: - tag: dev-latest secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 53a3187..a6833a5 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -12,12 +12,3 @@ jobs: test: name: Test uses: ./.github/workflows/test.yml - publish_docker: - name: Publish to Docker Hub - uses: ./.github/workflows/publish_docker.yml - needs: test - with: - tag: latest - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 1a53099..272320b 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -4,10 +4,6 @@ name: Publish to Docker Hub on: workflow_call: - inputs: - tag: - required: true - type: string secrets: DOCKERHUB_USERNAME: required: true @@ -21,12 +17,23 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + paradoxalarminterface/pai + tags: | + type=ref,event=branch + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,4 +44,5 @@ jobs: context: . platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64/v8 push: true - tags: paradoxalarminterface/pai:${{ inputs.tag }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebfa8d0..953a5c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,6 @@ jobs: name: Publish to Docker Hub uses: ./.github/workflows/publish_docker.yml needs: test - with: - tag: ${{ github.event.release.tag_name }} secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} From 9369230daa6b82976aa1309d06c93eafbbe7b570 Mon Sep 17 00:00:00 2001 From: Luca Paolini Date: Sun, 2 Jun 2024 19:56:20 +0200 Subject: [PATCH 3/6] Fix issue #463. --- paradox/hardware/evo/event.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paradox/hardware/evo/event.py b/paradox/hardware/evo/event.py index 5e852aa..6404a36 100644 --- a/paradox/hardware/evo/event.py +++ b/paradox/hardware/evo/event.py @@ -371,7 +371,7 @@ def _zone_generated_alarm(event, storage, *_, **__): level=EventLevel.INFO, tags=["tamper", "restore"], type="zone", - change=dict(zone_tamper_trouble=True), + change=dict(zone_tamper_trouble=False), message="Zone {label} tamper restore", ), 35: dict( From 6750a5b030323e13d8de0263ba0289abbe976b61 Mon Sep 17 00:00:00 2001 From: Claudiu Bucur Date: Sun, 16 Jun 2024 20:08:23 +0300 Subject: [PATCH 4/6] Home Assistant auto-discovery - set "code required" flags to false if no code provided --- paradox/interfaces/mqtt/entities/alarm_control_panel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paradox/interfaces/mqtt/entities/alarm_control_panel.py b/paradox/interfaces/mqtt/entities/alarm_control_panel.py index a91aeff..4352057 100644 --- a/paradox/interfaces/mqtt/entities/alarm_control_panel.py +++ b/paradox/interfaces/mqtt/entities/alarm_control_panel.py @@ -26,6 +26,12 @@ def serialize(self): )) if self.code is not None: config['code']=self.code + else: + config.update(dict( + code_arm_required=False, + code_disarm_required=False, + code_trigger_required=False + )) return config @property From d1a333deb0783153a8255327a0e32a22435baaf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:13:59 +0000 Subject: [PATCH 5/6] Bump docker/build-push-action from 5 to 6 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/publish_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index 272320b..2fcff79 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -39,7 +39,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64/v8 From 3a80da21ba037bafe0d6008b7cd8e0f3a61e28f5 Mon Sep 17 00:00:00 2001 From: MrG01 Date: Mon, 17 Jun 2024 22:13:28 +0200 Subject: [PATCH 6/6] Fix tests --- paradox/interfaces/mqtt/entities/alarm_control_panel.py | 6 ++++++ tests/interfaces/mqtt/test_entities.py | 3 +++ tests/interfaces/mqtt/test_homeassistant.py | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/paradox/interfaces/mqtt/entities/alarm_control_panel.py b/paradox/interfaces/mqtt/entities/alarm_control_panel.py index a91aeff..0edcb02 100644 --- a/paradox/interfaces/mqtt/entities/alarm_control_panel.py +++ b/paradox/interfaces/mqtt/entities/alarm_control_panel.py @@ -26,6 +26,12 @@ def serialize(self): )) if self.code is not None: config['code']=self.code + else: + config.update(dict( + code_arm_required=False, + code_disarm_required=False, + code_trigger_required=False + )) return config @property diff --git a/tests/interfaces/mqtt/test_entities.py b/tests/interfaces/mqtt/test_entities.py index f43c90c..edc61b1 100644 --- a/tests/interfaces/mqtt/test_entities.py +++ b/tests/interfaces/mqtt/test_entities.py @@ -25,6 +25,9 @@ def test_alarm_control_panel_serialize(mqtt_entity_factory): 'payload_arm_home': 'arm_stay', 'payload_arm_night': 'arm_sleep', 'payload_disarm': 'disarm', + 'code_arm_required': False, + 'code_disarm_required': False, + 'code_trigger_required': False } assert alarm_control_panel.configuration_topic == "homeassistant/alarm_control_panel/1234abcd/partition_partition_1/config" diff --git a/tests/interfaces/mqtt/test_homeassistant.py b/tests/interfaces/mqtt/test_homeassistant.py index 97515b5..a47562a 100644 --- a/tests/interfaces/mqtt/test_homeassistant.py +++ b/tests/interfaces/mqtt/test_homeassistant.py @@ -88,7 +88,10 @@ async def test_hass(mocker): "payload_disarm": "disarm", "payload_arm_home": "arm_stay", "payload_arm_away": "arm", - "payload_arm_night": "arm_sleep" + "payload_arm_night": "arm_sleep", + 'code_arm_required': False, + 'code_disarm_required': False, + 'code_trigger_required': False }, 0, True