menahishayan / Home-Assistant-TP-Link-Router

Home Assistant component for complete router administration of the TP Link Archer C50 and the TP Link N600
GNU General Public License v3.0
45 stars 6 forks source link

issue with latest HA 2022.3.6 #6

Open moshriq opened 2 years ago

moshriq commented 2 years ago

the config checker gives 'Platform error switch.tplink_router - Integration 'tplink_router' not found.'

theshop35 commented 2 years ago

I have same error. What's the solution. I have Tplink Archer C64 AC1200 router. Please help.

madeline-scyphers commented 2 years ago

@moshriq @theshop35 So the when I used HACS with the GitHub link, it didn't work because it didn't clone the latest version on main. It used the most recent tagged released from September, which didn't have the version in the manifest json file yet.

So I got it to work by cloning it instead, and then mv Home-Assistant-TP-Link-Router/custom_components/tplink_router/ tplink_router while at /config/custom_components to move just the custom components code. You can then do rm -r Home-Assistant-TP-Link-Router. Restart, It should then work.

Hopefully @menahishayan sees this and gets an updated version released. I think the code is all right, just not released.

madeline-scyphers commented 2 years ago

I lied, I think there might be other things wrong too.

2022-07-25 19:20:31 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy tplink_router
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 248, in async_setup_legacy
scanner = await hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/tplink_router/device_tracker.py", line 57, in get_scanner
scanner = cls(config[DOMAIN])
File "/config/custom_components/tplink_router/device_tracker.py", line 84, in __init__
self.success_init = self._update_info()
File "/config/custom_components/tplink_router/device_tracker.py", line 468, in _update_info
session.get(base_url, headers=header)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 369, in prepare
self.prepare_headers(headers)
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 491, in prepare_headers
check_header_validity(header)
File "/usr/local/lib/python3.10/site-packages/requests/utils.py", line 1037, in check_header_validity
raise InvalidHeader(
requests.exceptions.InvalidHeader: Header part ('User-Agent') from {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0'} must be of type str or bytes, not <class 'multidict._multidict.istr'>
jhalak1984 commented 1 year ago

Am I missing something? Can't find integration in HACS at all?

prullmann commented 1 year ago

You might want to try this different fork of _tplinkrouter which mentions:

This fork has been updated to work with Home Assistant version 2022.7+