From 1534227df8334c5abb4d97e7e0f2f104947845f2 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 26 Mar 2023 16:34:47 -0600 Subject: [PATCH 1/4] Update path to hook script Signed-off-by: Joe Block --- {hooks/scripts => .hook-scripts}/clean-up-pyc-and-pyo-files | 0 .pre-commit-config.yaml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {hooks/scripts => .hook-scripts}/clean-up-pyc-and-pyo-files (100%) diff --git a/hooks/scripts/clean-up-pyc-and-pyo-files b/.hook-scripts/clean-up-pyc-and-pyo-files similarity index 100% rename from hooks/scripts/clean-up-pyc-and-pyo-files rename to .hook-scripts/clean-up-pyc-and-pyo-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d7bbb5..62e1c15 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: hooks: - id: clean-up-pyc-and-pyo-files name: Scrub all .pyc and .pyo files before committing - entry: ./hooks/scripts/clean-up-pyc-and-pyo-files + entry: ./.hook-scripts/clean-up-pyc-and-pyo-files language: script - repo: https://github.com/pre-commit/pre-commit-hooks From 4523087c716fd5a1d63e687cca938cef61634fed Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 26 Mar 2023 16:36:20 -0600 Subject: [PATCH 2/4] Update poetry lock file Signed-off-by: Joe Block --- poetry.lock | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/poetry.lock b/poetry.lock index 3a2126a..2c6d347 100644 --- a/poetry.lock +++ b/poetry.lock @@ -152,19 +152,19 @@ test = ["pytest (>=6)"] [[package]] name = "filelock" -version = "3.10.2" +version = "3.10.6" description = "A platform independent file lock." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "filelock-3.10.2-py3-none-any.whl", hash = "sha256:eb8f0f2d37ed68223ea63e3bddf2fac99667e4362c88b3f762e434d160190d18"}, - {file = "filelock-3.10.2.tar.gz", hash = "sha256:75997740323c5f12e18f10b494bc11c03e42843129f980f17c04352cc7b09d40"}, + {file = "filelock-3.10.6-py3-none-any.whl", hash = "sha256:52f119747b2b9c4730dac715a7b1ab34b8ee70fd9259cba158ee53da566387ff"}, + {file = "filelock-3.10.6.tar.gz", hash = "sha256:409105becd604d6b176a483f855e7e8903c5cb2873e47f2c64f66a370c046aaf"}, ] [package.extras] docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] [[package]] name = "flake8" @@ -197,14 +197,14 @@ files = [ [[package]] name = "identify" -version = "2.5.21" +version = "2.5.22" description = "File identification library for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "identify-2.5.21-py2.py3-none-any.whl", hash = "sha256:69edcaffa8e91ae0f77d397af60f148b6b45a8044b2cc6d99cafa5b04793ff00"}, - {file = "identify-2.5.21.tar.gz", hash = "sha256:7671a05ef9cfaf8ff63b15d45a91a1147a03aaccb2976d4e9bd047cbbc508471"}, + {file = "identify-2.5.22-py2.py3-none-any.whl", hash = "sha256:f0faad595a4687053669c112004178149f6c326db71ee999ae4636685753ad2f"}, + {file = "identify-2.5.22.tar.gz", hash = "sha256:f7a93d6cf98e29bd07663c60728e7a4057615068d7a639d132dc883b2d54d31e"}, ] [package.extras] @@ -301,19 +301,19 @@ files = [ [[package]] name = "platformdirs" -version = "3.1.1" +version = "3.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.1.1-py3-none-any.whl", hash = "sha256:e5986afb596e4bb5bde29a79ac9061aa955b94fca2399b7aaac4090860920dd8"}, - {file = "platformdirs-3.1.1.tar.gz", hash = "sha256:024996549ee88ec1a9aa99ff7f8fc819bb59e2c3477b410d90a16d32d6e707aa"}, + {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, + {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, ] [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pluggy" @@ -333,14 +333,14 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.2.0" +version = "3.2.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "pre_commit-3.2.0-py2.py3-none-any.whl", hash = "sha256:f712d3688102e13c8e66b7d7dbd8934a6dda157e58635d89f7d6fecdca39ce8a"}, - {file = "pre_commit-3.2.0.tar.gz", hash = "sha256:818f0d998059934d0f81bb3667e3ccdc32da6ed7ccaac33e43dc231561ddaaa9"}, + {file = "pre_commit-3.2.1-py2.py3-none-any.whl", hash = "sha256:a06a7fcce7f420047a71213c175714216498b49ebc81fe106f7716ca265f5bb6"}, + {file = "pre_commit-3.2.1.tar.gz", hash = "sha256:b5aee7d75dbba21ee161ba641b01e7ae10c5b91967ebf7b2ab0dfae12d07e1f1"}, ] [package.dependencies] @@ -501,14 +501,14 @@ six = ">=1.5" [[package]] name = "pytz" -version = "2022.7.1" +version = "2023.2" description = "World timezone definitions, modern and historical" category = "main" optional = false python-versions = "*" files = [ - {file = "pytz-2022.7.1-py2.py3-none-any.whl", hash = "sha256:78f4f37d8198e0627c5f1143240bb0206b8691d8d7ac6d78fee88b78733f8c4a"}, - {file = "pytz-2022.7.1.tar.gz", hash = "sha256:01a0681c4b9684a28304615eba55d1ab31ae00bf68ec157ec3708a8182dbbcd0"}, + {file = "pytz-2023.2-py2.py3-none-any.whl", hash = "sha256:8a8baaf1e237175b02f5c751eea67168043a749c843989e2b3015aa1ad9db68b"}, + {file = "pytz-2023.2.tar.gz", hash = "sha256:a27dcf612c05d2ebde626f7d506555f10dfc815b3eddccfaadfc7d99b11c9a07"}, ] [[package]] From fc57a1df21e42980570b27d4cf66600dcbb8ce1f Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 26 Mar 2023 16:36:33 -0600 Subject: [PATCH 3/4] BUGFIX: Binary sensor was writing inverted values, fix `payload_on` was set to `off`, and `payload_off` was set to `on` Signed-off-by: Joe Block --- ha_mqtt_discoverable/sensors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ha_mqtt_discoverable/sensors.py b/ha_mqtt_discoverable/sensors.py index 4df20cc..f4736a2 100644 --- a/ha_mqtt_discoverable/sensors.py +++ b/ha_mqtt_discoverable/sensors.py @@ -35,9 +35,9 @@ class BinarySensorInfo(EntityInfo): off_delay: Optional[int] = None """For sensors that only send on state updates (like PIRs), this variable sets a delay in seconds after which the sensor’s state will be updated back to off.""" - payload_off: str = "on" + payload_off: str = "off" """Payload to send for the ON state""" - payload_on: str = "off" + payload_on: str = "on" """Payload to send for the OFF state""" From 73ad8f0ca4beea51c14c7264d117113c0fdd875a Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 26 Mar 2023 16:40:56 -0600 Subject: [PATCH 4/4] Bump version to 0.8.1 Signed-off-by: Joe Block --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5701f33..26739c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ha-mqtt-discoverable" -version = "0.8.0" +version = "0.8.1" description = "" authors = ["Joe Block "] readme = "README.md"