Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
fix: add new models
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Jun 27, 2024
1 parent 33abf7b commit 41716a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions custom_components/jvc_projectors/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
DOMAIN = "jvc_projectors"
NAME = "JVC Projector Custom"
MANUFACTURER = "JVC"

CONF_NEW_MODEL = "new_model"
4 changes: 2 additions & 2 deletions custom_components/jvc_projectors/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand All @@ -14,5 +14,5 @@
"@iloveicedgreentea"
],
"iot_class": "local_polling",
"version": "5.0.0"
"version": "5.0.1"
}
3 changes: 3 additions & 0 deletions custom_components/jvc_projectors/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
}
)

Expand All @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41716a1

Please sign in to comment.