-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't add integration #75
Comments
I am not able to reproduce this unfortunately and thus can not fix it. I can see that you are running it in a virtualenv. Can you please check that you have the latest version of |
Hi there @DurgNomis-drol , I am having the same issue as @saintfrater . I already checked and my System Health
Home Assistant Community Store
Home Assistant Cloud
Lovelace
|
@savvasha Where are you located in the world? Your Home Assistant timezones is set in Asia? 🤔 Just curious if it is something to do with where the Toyota account is created. |
@DurgNomis-drol Well... I am living in Cyprus which politically is in Europe. Nicosia is the capital city. The strange thing is that your integration was working perfectly... until it stopped working! I tried to re-install it and received the error with the language. I even tried older versions but with the same result... |
That makes sense. The other guys is from Belgium, so that is probably not the problem then. I will see if I can create a test script tomorrow for you guys so we can isolate the problem 😊 |
Great! Thanks :) |
Please make sure that you have the latest version of IMPORTANT: Sensitiv data should be censored, but please double check anyways. 😃 import json
import asyncio
from mytoyota.client import MyT
username = "jane@doe.com"
password = "MyPassword"
locale = "en-gb"
client = MyT(username=username, password=password, locale=locale, region="europe")
async def get_information():
print("Logging in...")
await client.login()
print("Retrieving cars...")
cars = await client.get_vehicles()
for car in cars:
vehicle = await client.get_vehicle_status(car)
loop = asyncio.get_event_loop()
loop.run_until_complete(get_information())
loop.close() |
Please accept my ignorance... But how can I run your script inside my docker container? |
You don't have to run it in the container. This script uses the underlying package. You can/should run this in any linux commandline, preferably on the same machine as you HA install. Just create a python script |
Hmm ok. As I mentioned above, my machine is a Synology NAS and I am running HA using a docker container with the official image from homeassistant.
Probably I need to find a way to do the procedure inside the container. |
You need to install the |
I think is better to wait for @saintfrater to try it, cause I dont want to mess with my synology environment by installing python components :) |
You can also do this on any other PC that runs linux 😃 |
Ok, I tried it to my laptop with linux and got the following:
nothing else |
Can you try this below instead? 😃 import json
import asyncio
import logging
logging.basicConfig(level=logging.DEBUG)
from mytoyota.client import MyT
username = "jane@doe.com"
password = "MyPassword"
locale = "en-gb"
client = MyT(username=username, password=password, locale=locale, region="europe")
async def get_information():
print("Logging in...")
await client.login()
print("Retrieving cars...")
cars = await client.get_vehicles()
for car in cars:
vehicle = await client.get_vehicle_status(car)
loop = asyncio.get_event_loop()
loop.run_until_complete(get_information())
loop.close() |
It seems to working? I mask out some info.
|
It works for you on the laptop. Below is a small script for you to run on the Synology NAS, you won't need to install any thing, but this will test the specific function that creates the error you are having. from langcodes import Language
from langcodes.tag_parser import LanguageTagError
locale = "en-gb"
valid = False
if locale:
try:
valid = Language.get(locale).is_valid()
except LanguageTagError:
pass
print(valid) |
I tried to open a bash console inside my HA container to run the above script. I received the following error:
|
But I am also getting the following when I try to install langcodes library:
|
Nevermind. I managed to create a python file inside bash and executed.
And then I used the same method to run your first script:
|
It is really strange that the check works when run manually, but when the same function is run in side the module it fails. 🤔 I am really at a lose of what to do to mitigate this problem. Can you double check that you are running the latest version of this integration? |
Hello, sorry for the delay; I've run the script :
So same error... I've checked my version and upgraded my OS and instances: System Health
Home Assistant Community Store
Home Assistant Cloud
Lovelace
|
What other custom integrations do you guys have installed? |
I've
|
Hi there! Looks like I have the same issue here. The log says:
I already tried the scripts above, with a similar outcome as savvasha. Although the script returned less sensors in my case, but that is a limitation of my Corolla I guess ;-) The script that is checking the locale returns: True My installed langcode has version 3.3.0 If you are also interested in timezones and regions ... My Pi and I are located in Germany ;-) And I already ran dos2unix over the files, because every line ended with ^M |
Does the integration work if you use an older version of it? Some changes have been made to |
Well ... I'm not sure, if what I'm doing happens system wide. Of course there's no problem, to install langcodes 3.2.1 or an older version, but that doesn't change anything for the toyota integration. Still the same error. Do I have to install the langcodes in a "special" way to make it persistant and system wide? I don't use pip that much. |
I meant try to install an older version of this integration, not When i have time I will rewrite the check function in |
Can someone please try to install the latest master and test if it fixes you problem. I disabled the check for now until i can create a better validation function. Hope this fixes you problems 😃 |
Hi @DurgNomis-drol ! It is working perfectly!! Thank you very much :) |
Great to hear, I will publish a new release (1.2.4) 😃 |
Everybody please update to the latest version (1.2.4) https://github.com/DurgNomis-drol/ha_toyota/releases/tag/v1.2.4 |
Thanks!! Working like a charm again! |
Works again for me too, thanks for your effort! :-) |
Describe the bug
When I try to setup the account, I get "Language code is not valid."
To Reproduce
Steps to reproduce the behavior:
I've installed the "Toyota Connected Services" via HACS
Then I try to add and integration normally (via Settings -> Integration -> Add Integration, the lookup for toyota)
I'll put email account (working on MYT), password and select "Europe"
Then click on "submit"
Expected behavior
connection to MYT :D
Additional context
System Health
Home Assistant Community Store
Home Assistant Cloud
Lovelace
The text was updated successfully, but these errors were encountered: