fsaris / home-assistant-awox

AwoX mesh light integration for Home Assistant
MIT License
84 stars 23 forks source link

Add german translation file #35

Closed schiegg closed 3 years ago

schiegg commented 3 years ago

I´m new to homeassistant custom integrations development but I hope to be able to contribute at least a small part to bring this project forward.

I tested the translation but I think it uses the strings.json therefore ignoring the subfolder? However https://developers.home-assistant.io/docs/internationalization/custom_integration defines this as the correct way?

PS: I do not have an AwoX account and therefore hope to be able to use the full local environment soon. I will investigate and test in this direction.

fsaris commented 3 years ago

Tnx for the translations, should be the correct location indeed.

I do not have an AwoX account and therefore hope to be able to use the full local environment soon.

You don't have or don't want to create a a account?

It's free and you could just create a awox account to connect the lights once and then delete it again.

schiegg commented 3 years ago

You don't have or don't want to create a a account?

Honestly I don't want to register if there is a way to do this without. I was also looking at Leiaz's project before (which enables us to do it without the app if I understand it right) but did not have the understanding of homeassistant integration development to create a repo here. After I saw yours, I wanted to contribute as soon as possible.

What steps would be necessary for it? Can I help in any way?

fsaris commented 3 years ago

Most is already prepared. The config flow needs an adjustment so you can switch between the AwoX account option and local scanning.

https://github.com/fsaris/home-assistant-awox/blob/f9e7d258f2103fcbd2b4bb60521bbde7c666b520/custom_components/awox/config_flow.py#L44

My first attempt was the local scanning. But I wanted to have the ability to still use the AwoX app during development as the lights already in use and the rest wanted to be able to control them when I wasn't around 😄

You could give it a try by disabling this line temporary so the manual flow is used.

https://github.com/fsaris/home-assistant-awox/blob/f9e7d258f2103fcbd2b4bb60521bbde7c666b520/custom_components/awox/config_flow.py#L42

        #return await self.async_step_awox_connect()
schiegg commented 3 years ago

the rest wanted to be able to control them when I wasn't around

Haha I know this situation :smile:

I disabled it but then it asks me for the mesh credentials which I do not have at this point. Do I need to create a mesh manually or could't this be done by the integration on the fly?

I also tried providing new mesh data but this results in an error, caused by the iteration at line 96 which fails by an empty discoveries object.

https://github.com/fsaris/home-assistant-awox/blob/f9e7d258f2103fcbd2b4bb60521bbde7c666b520/custom_components/awox/config_flow.py#L96-L103

As it seems to me that line 85 is intended to be responsible for handling an empty discovery with provided mesh credentials, I enforced it getting triggered (by setting scan_successful = False the line before :sweat_smile:) but also entering the MAC of my light did not fill the discoveriesobject magically... I don't quite understand what these lines are supposed to be good for then. Should't it be if not self._discoveries: as you test in line 106?

https://github.com/fsaris/home-assistant-awox/blob/f9e7d258f2103fcbd2b4bb60521bbde7c666b520/custom_components/awox/config_flow.py#L85-L92

I must confess that my Python skill is not the best if I understand something incorrectly...

schiegg commented 3 years ago

Btw, back to the initial topic: The translation seems to work now after I restarted my HA twice :man_shrugging: