Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.23k stars 2.49k forks source link

Translation Default language #25

Closed KiraPC closed 1 year ago

KiraPC commented 1 year ago

Hi,

I've just installed the integration in my HA env.

I'm italian and the default language is IT, but when I added the integration it seems that there is no default language in case the HA one is missing in the translations folder and all the sensor appear like number, eg machine mode was 0 instead of disconnected.

I added a file it.json with the same value of en.json and now machine mode is Disconnected.

I'll provide a it translation but i think is better to set en as default if HA lang is not found in translations.

Andre0512 commented 1 year ago

Hi, I thought English would be used as the default language, but than I will have a look at it and try to set this up :+1: A pr would be nice! If you need program translations, have look at pyhOn's translate command to read out the official translations :slightly_smiling_face:

KiraPC commented 1 year ago

@Andre0512 Ok thansk. I would like to also to give a readble value to the program phase, do you know which translation key I have to look for?

Andre0512 commented 1 year ago

I saw you found it, thanks for your contribution 👍

KiraPC commented 1 year ago

Actually, I found just the translation keys of what was already in en. I'm looking for readble for programPhase

Andre0512 commented 1 year ago

Okay sorry, there isn't a translation key for every sensor. You can add it to the entity descriptions like here for tumble dryer and then use it in the json files.

KiraPC commented 1 year ago

Sure, I know that. I just added some values like

"wd_program_phase": {
        "state": {
          "0": "Avvio",
          "2": "Lavaggio",
          "4": "-",
          "6": "-",
          "11": "Centrifuga",
          "7": "Asciugatura"
        }
      },
      "wd_current_program": {
        "state": {
          "10": "Rapido 30'",
          "17": "Asciugatura bassa",
          "12": "Misti e Colorati 59'",
          "16": "Asciugatura alta"
        }
      },

Because i run my WD this morning and I was able to fetch some, but no others.

Andre0512 commented 1 year ago

Ahh, now I understand 😃 I'm afraid the only way to find out is by trying, so far I didn't found any list for these values. I only found the translations which can be read out by pyhOn, but I couldn't find any translations for the program phases so far. Maybe it's hidden somewhere there, I haven't been able to study all of it yet...

KiraPC commented 1 year ago

I supposed.

I'l try later. I've a trip tomorrow so no more time to test :)

Andre0512 commented 1 year ago

Okay thank you and have fun 😄

Andre0512 commented 1 year ago

Hi, I had a deep look into the app and found the translation for each phase :partying_face: Check out the newest beta, I created a script to translate the phase and some other things to all available languages.

KiraPC commented 1 year ago

Oh, you're great.

I'm out of home until 2 of may but I'll have a look to the code now 😁

drudgebg commented 1 year ago

Hi, I had a deep look into the app and found the translation for each phase 🥳 Check out the newest beta, I created a script to translate the phase and some other things to all available languages.

Hi, after looking deep, was there any more information about "program_phases_td"? My Haier dryer shows 11, 15, 17 which are missing in the English language and I don't know what it does in these phases.

Andre0512 commented 1 year ago

@drudgebg I searched a lot, but can't find out what 17 is, the other should be translated in the latest release.

Andre0512 commented 1 year ago

In the latest version are a lot of translation and with the hint of thegareth in #35 we have a lot less ugly numbers now, so I close this issue for now.