MrAsterisco / homebridge-hisense-tv

A Homebridge plugin to control RemoteNow-compatible HiSense TVs.
MIT License
21 stars 8 forks source link

Authorise Issue #24

Closed evans-aiden closed 2 years ago

evans-aiden commented 2 years ago

Describe Your Problem: I'm attempting to Authorise in terminal to remove the error while fetching inputs (as seen in logs). Currently Home knows if the device is on or off but does not know what input is active. Whenever I try to authorise I get an error about importing main as seen below. I have installed the pip install hisensetv from the plugin thread with no change in error. Still relatively new to this.

Logs:

28/11/21, 12:46:09 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:19 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:29 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:39 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:49 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null
28/11/21, 12:46:59 pmHisense TV BridgeHiSenseTVERRORAn error occurred while fetching inputs: TypeError: Cannot read property 'join' of null

When trying to authorise in terminal:

hoobs@hoobs:/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv $ python hisensetv.py ***.***.**.** --get state --ifname eth0
Traceback (most recent call last):
  File "/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py", line 3, in <module>
    from hisensetv import __main__
  File "/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py", line 3, in <module>
    from hisensetv import __main__
ImportError: cannot import name '__main__' from partially initialized module 'hisensetv' (most likely due to a circular import) (/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv/hisensetv.py)
hoobs@hoobs:/usr/local/share/.cache/yarn/v6/npm-homebridge-hisense-tv-remotenow-1.1.0-f08b247d8aa5131e4d18a18be824c3663919e086-integrity/node_modules/homebridge-hisense-tv-remotenow/bin/hisensetv $ 

Plugin Config:

{
    "accessories": [],
    "platforms": [
        {
            "platform": "HiSenseTV",
            "ifname": "eth0",
            "devices": [
                {
                    "id": "HiSenseTV****",
                    "name": "HiSense TV",
                    "ipaddress": "***.***.**.**",
                    "macaddress": "**:**:**:**:**:**",
                    "sslmode": "default"
                }
            ]
        }
    ]
}

Screenshots:

Environment:

MrAsterisco commented 2 years ago

Hi @stads0 , thanks for opening this issue and using the plugin!

I have installed the pip install hisensetv

What do you mean with this? The hisensetv plugin is embedded in the Homebridge plugin (you can find it in the bin folder). You must use this version and not the original version, which is unfortunately incompatible with the Homebridge plugin.

evans-aiden commented 2 years ago

Hi @MrAsterisco,

I got confused and installed the original. However the issue and the response I got in terminal was exactly the same before I did that and after.

When I copied the modified Hisensetv from the bin folder provided in this plugin, I got the error as in my above post.

Hopefully this makes sense

MrAsterisco commented 2 years ago

@stads0 I can see you're using Hoobs, would the solution in this issue help you? https://github.com/MrAsterisco/homebridge-hisense-tv/issues/22

MrAsterisco commented 2 years ago

Closing as there was no activity for quite some time. Feel free to reopen if the linked issue didn't fix your problem.