From 41716a1ce1ba33c36480e40490f68fff186024cd Mon Sep 17 00:00:00 2001 From: iloveicedgreentea <31193909+iloveicedgreentea@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:17:26 -0400 Subject: [PATCH] fix: add new models --- custom_components/jvc_projectors/const.py | 2 ++ custom_components/jvc_projectors/manifest.json | 4 ++-- custom_components/jvc_projectors/remote.py | 3 +++ readme.md | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/custom_components/jvc_projectors/const.py b/custom_components/jvc_projectors/const.py index e44fd6d..7f207e3 100644 --- a/custom_components/jvc_projectors/const.py +++ b/custom_components/jvc_projectors/const.py @@ -3,3 +3,5 @@ DOMAIN = "jvc_projectors" NAME = "JVC Projector Custom" MANUFACTURER = "JVC" + +CONF_NEW_MODEL = "new_model" diff --git a/custom_components/jvc_projectors/manifest.json b/custom_components/jvc_projectors/manifest.json index 3a3dcab..591e35f 100644 --- a/custom_components/jvc_projectors/manifest.json +++ b/custom_components/jvc_projectors/manifest.json @@ -4,7 +4,7 @@ "config_flow": false, "documentation": "https://www.home-assistant.io/integrations/jvc_projector", "requirements": [ - "pyjvc==5.0.0" + "pyjvc==5.0.1" ], "ssdp": [], "zeroconf": [], @@ -14,5 +14,5 @@ "@iloveicedgreentea" ], "iot_class": "local_polling", - "version": "5.0.0" + "version": "5.0.1" } \ No newline at end of file diff --git a/custom_components/jvc_projectors/remote.py b/custom_components/jvc_projectors/remote.py index 470a3b2..df10ee0 100644 --- a/custom_components/jvc_projectors/remote.py +++ b/custom_components/jvc_projectors/remote.py @@ -4,6 +4,7 @@ import logging import threading from jvc_projector.jvc_projector import JVCProjector +from .const import CONF_NEW_MODEL import voluptuous as vol from homeassistant.components.remote import PLATFORM_SCHEMA, RemoteEntity @@ -26,6 +27,7 @@ vol.Required(CONF_NAME): cv.string, vol.Required(CONF_HOST): cv.string, vol.Optional(CONF_PASSWORD): cv.string, + vol.Optional(CONF_NEW_MODEL, default=False): bool, } ) @@ -45,6 +47,7 @@ def setup_platform( password=password, logger=_LOGGER, connect_timeout=int(config.get(CONF_TIMEOUT, 3)), + new_model=config.get(CONF_NEW_MODEL, False) ) # create a long lived connection s = jvc_client.open_connection() diff --git a/readme.md b/readme.md index dab4f84..b96d42b 100644 --- a/readme.md +++ b/readme.md @@ -35,8 +35,11 @@ remote: name: { entity name } password: { password } (optional for non-NZ) host: { IP addr } + new_model: false | true (true if you have NZ800/900 or newer) ``` +The new_model flag is now required because JVC made a breaking change to how the password is encoded. Because I can't know the model before connecting, you have to tell the library to handle the password differently. + You can use the remote entity attributes in sensors, automations, etc. ### Adding attributes as sensors