iloveicedgreentea / jvc_homeassistant

JVC Integration for Home Assistant
20 stars 4 forks source link

After updating from v3.4.1 to v3.4.5 a TypeError: 'str' object cannot be interpreted as an integer #25

Closed megapearl closed 1 year ago

megapearl commented 1 year ago

Logger: homeassistant.components.remote Source: custom_components/jvc_projectors/remote.py:49 Integration: Remote (documentation, issues) First occurred: 12:43:30 (1 occurrences) Last logged: 12:43:30

Error while setting up jvc_projectors platform for remote Traceback (most recent call last): File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/jvc_projectors/remote.py", line 49, in setup_platform jvc_client.open_connection() File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 60, in open_connection msg, success = self.reconnect() File "/srv/homeassistant/lib/python3.10/site-packages/jvc_projector/jvc_projector.py", line 75, in reconnect self.client.settimeout(self.connect_timeout) TypeError: 'str' object cannot be interpreted as an integer**

iloveicedgreentea commented 1 year ago

Can you post your configuration

The scan interval should be an integer not a string. I will add a conversion check

megapearl commented 1 year ago

Relevant snippet of configuration.yaml

remote:
  - platform: jvc_projectors
    name: Cinema Projector
#    password: ******
    host: cinema-projector.flissinger.local
    timeout: 5
    scan_interval: 15

scan_interval: 15 looks like an integer to me

iloveicedgreentea commented 1 year ago

Okay maybe the underlying config is converted as a string inside hass. I will add an int conversion shortly

iloveicedgreentea commented 1 year ago

Under HACS, go to the repo, click redownload, and enable beta versions then try 3.4.6. I fixed the issue with types and added a new "timeout" field you should add, 3-5 seconds should work. Let me know how that goes.

megapearl commented 1 year ago

A great, it's working again.

image

Offtopic: Is it possible to add 'Lamp mode' for the lamp based projector models?

iloveicedgreentea commented 1 year ago

Sure I can look into doing that tonight

iloveicedgreentea commented 1 year ago

Actually can you test something for me? Do you have an NX7/8/9? Need to see if content type, hdr, and theater opt and eshift is supported for you

megapearl commented 1 year ago

Ofcourse, no problem, what can I test? Do you need screenshots of the projector menu?

Out of my head, hdr is supported and theater opt also, and eshift (pixel shift) also

iloveicedgreentea commented 1 year ago

Thanks I am going to release another beta version shortly which enables those things for NX models. Let me know if you get timeouts in your logs which would mean they are not supported.

iloveicedgreentea commented 1 year ago

I released 3.4.7 beta can you please update and see what happens? Model should show your correct model and you should see lamp power and hdr populated

megapearl commented 1 year ago

Looks good, will test tomorrow when the projector is on and running.

5F856C12-F2B4-48B0-BEA8-6693D9467B7A

iloveicedgreentea commented 1 year ago

3.5.0 should add in lamp power for you

megapearl commented 1 year ago

So far, so good :-)

image

No errors in logs yet.

Some screenshots of the projectors menu:

image

image

image

image

image

image

image

image

image

image

iloveicedgreentea commented 1 year ago

Thanks for lamp power do you have low med high or just low and high? The API spec only has normal and high, and also no option to get content type

megapearl commented 1 year ago

It's just Low and High

image

iloveicedgreentea commented 1 year ago

okay cool if you encounter any more issues feel free to open an issue 👍