Skip to content

Commit

Permalink
v1.8.0
Browse files Browse the repository at this point in the history
added FR and NL translations/en.json
Username added in hub name to make clear distinction when adding multiple entities
  • Loading branch information
myTselection committed Oct 5, 2024
1 parent 76f8690 commit 1fbf3d7
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 9 deletions.
6 changes: 3 additions & 3 deletions custom_components/telenet_telemeter/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def create_schema(entry, option=False):

data_schema = OrderedDict()
data_schema[
vol.Required(CONF_USERNAME, description="username")
vol.Required(CONF_USERNAME, description="Email")
] = str
data_schema[
vol.Required(CONF_PASSWORD, description="password")
vol.Required(CONF_PASSWORD, description="Password")
] = str
data_schema[
vol.Optional("internet", default=default_internet, description="Track internet usage?")
Expand Down Expand Up @@ -110,7 +110,7 @@ async def async_step_user(self, user_input=None): # pylint: disable=dangerous-d

if user_input is not None:
await self.test_setup(user_input)
return self.async_create_entry(title=NAME, data=user_input)
return self.async_create_entry(title=f'{NAME} {user_input.get("username","")}', data=user_input)

return await self._show_config_form(user_input)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/telenet_telemeter/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/myTselection/telenet_telemeter/issues",
"requirements": ["beautifulsoup4", "html5lib"],
"version": "1.7.1"
"version": "1.8.0"
}
1 change: 1 addition & 0 deletions custom_components/telenet_telemeter/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ async def async_update(self):
self._peak_usage = self._data._telemeter.get('internetusage')[0].get('availableperiods')[0].get('usages')[0].get('totalusage').get('peak')
self._offpeak_usage = self._data._telemeter.get('internetusage')[0].get('availableperiods')[0].get('usages')[0].get('totalusage').get('offpeak')
self._squeezed = bool(self._data._telemeter.get('internetusage')[0].get('availableperiods')[0].get('usages')[0].get('squeezed'))
self._extendedvolume_usage = 0
else:
# self._wifree_usage = self._data._telemeter.get('internet').get('wifreeUsage').get('usedUnits')
self._wifree_usage = 0
Expand Down
10 changes: 5 additions & 5 deletions custom_components/telenet_telemeter/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"user": {
"description": "Setup a Telenet Telementer sensor, username and password are required. Please indicate if internet and/or mobile usage is to be tracked.",
"data": {
"username": "Username",
"username": "Email",
"password": "Password",
"internet": "Internet",
"mobile": "Mobile"
Expand All @@ -14,7 +14,7 @@
"edit": {
"description": "Edit Setup a Telenet Telemeter sensor, username and password are required. Please indicate if internet and/or mobile usage is to be tracked.",
"data": {
"username": "Username",
"username": "Email",
"password": "Password",
"internet": "Internet",
"mobile": "Mobile"
Expand All @@ -23,7 +23,7 @@

},
"error": {
"missing username": "Please provide a valid Telenet username",
"missing username": "Please provide a valid Telenet username (email)",
"missing password": "Please provide a valid Telenet password",
"missing internet": "Please indicate if internet usage is to be tracked",
"missing mobile": "Please indicate if mobile usage is to be tracked",
Expand All @@ -36,15 +36,15 @@
"edit": {
"description": "Edit setup a Telenet Telemeter sensor, username and password are required. Please indicate if internet and/or mobile usage is to be tracked.",
"data": {
"username": "Username",
"username": "Email",
"password": "Password",
"internet": "Internet",
"mobile": "Mobile"
}
}
},
"error": {
"missing username": "Please provide a valid Telenet username",
"missing username": "Please provide a valid Telenet username (Email)",
"missing password": "Please provide a valid Telenet password",
"missing internet": "Please indicate if internet usage is to be tracked",
"missing mobile": "Please indicate if mobile usage is to be tracked",
Expand Down
60 changes: 60 additions & 0 deletions custom_components/telenet_telemeter/translations/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"config": {
"title": "Telenet Telemeter",
"step": {
"user": {
"description": "Configurer un capteur Telenet Telemeter, nom d'utilisateur et mot de passe requis. Veuillez indiquer si l'utilisation d'internet et/ou de mobile doit être suivie.",
"data": {
"username": "E-mail",
"password": "Mot de passe",
"internet": "Internet",
"mobile": "Mobile"
}
},
"edit": {
"description": "Modifier la configuration d'un capteur Telenet Telemeter, nom d'utilisateur et mot de passe requis. Veuillez indiquer si l'utilisation d'internet et/ou de mobile doit être suivie.",
"data": {
"username": "E-mail",
"password": "Mot de passe",
"internet": "Internet",
"mobile": "Mobile"
}
}
},
"error": {
"missing username": "Veuillez fournir un nom d'utilisateur Telenet valide (e-mail)",
"missing password": "Veuillez fournir un mot de passe Telenet valide",
"missing internet": "Veuillez indiquer si l'utilisation d'internet doit être suivie",
"missing mobile": "Veuillez indiquer si l'utilisation mobile doit être suivie",
"missing data options handler": "Le gestionnaire d'options a échoué",
"no_valid_settings": "Aucun paramètre valide, fournissez le nom d'utilisateur, le mot de passe, internet & mobile dans la configuration ha."
}
},
"options": {
"step": {
"edit": {
"description": "Modifier la configuration d'un capteur Telenet Telemeter, nom d'utilisateur et mot de passe requis. Veuillez indiquer si l'utilisation d'internet et/ou de mobile doit être suivie.",
"data": {
"username": "E-mail",
"password": "Mot de passe",
"internet": "Internet",
"mobile": "Mobile"
}
}
},
"error": {
"missing username": "Veuillez fournir un nom d'utilisateur Telenet valide (e-mail)",
"missing password": "Veuillez fournir un mot de passe Telenet valide",
"missing internet": "Veuillez indiquer si l'utilisation d'internet doit être suivie",
"missing mobile": "Veuillez indiquer si l'utilisation mobile doit être suivie",
"missing data options handler": "Le gestionnaire d'options a échoué",
"no_valid_settings": "Aucun paramètre valide, fournissez le nom d'utilisateur, le mot de passe, internet & mobile dans la configuration ha."
}
},
"services": {
"reboot_internet": {
"name": "redémarrer_internet",
"description": "Redémarrer le modem internet"
}
}
}
60 changes: 60 additions & 0 deletions custom_components/telenet_telemeter/translations/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"config": {
"title": "Telenet Telemeter",
"step": {
"user": {
"description": "Stel een Telenet Telemeter-sensor in, gebruikersnaam en wachtwoord zijn vereist. Geef aan of internet- en/of mobiel gebruik gevolgd moet worden.",
"data": {
"username": "E-mail",
"password": "Wachtwoord",
"internet": "Internet",
"mobile": "Mobiel"
}
},
"edit": {
"description": "Bewerk de instelling van een Telenet Telemeter-sensor, gebruikersnaam en wachtwoord zijn vereist. Geef aan of internet- en/of mobiel gebruik gevolgd moet worden.",
"data": {
"username": "E-mail",
"password": "Wachtwoord",
"internet": "Internet",
"mobile": "Mobiel"
}
}
},
"error": {
"missing username": "Geef een geldige Telenet-gebruikersnaam (e-mail) op",
"missing password": "Geef een geldig Telenet-wachtwoord op",
"missing internet": "Geef aan of internetgebruik gevolgd moet worden",
"missing mobile": "Geef aan of mobiel gebruik gevolgd moet worden",
"missing data options handler": "Optie-handler is mislukt",
"no_valid_settings": "Geen geldige instellingen, geef gebruikersnaam, wachtwoord, internet & mobiel op in ha-configuratie."
}
},
"options": {
"step": {
"edit": {
"description": "Bewerk de instelling van een Telenet Telemeter-sensor, gebruikersnaam en wachtwoord zijn vereist. Geef aan of internet- en/of mobiel gebruik gevolgd moet worden.",
"data": {
"username": "E-mail",
"password": "Wachtwoord",
"internet": "Internet",
"mobile": "Mobiel"
}
}
},
"error": {
"missing username": "Geef een geldige Telenet-gebruikersnaam (e-mail) op",
"missing password": "Geef een geldig Telenet-wachtwoord op",
"missing internet": "Geef aan of internetgebruik gevolgd moet worden",
"missing mobile": "Geef aan of mobiel gebruik gevolgd moet worden",
"missing data options handler": "Optie-handler is mislukt",
"no_valid_settings": "Geen geldige instellingen, geef gebruikersnaam, wachtwoord, internet & mobiel op in ha-configuratie."
}
},
"services": {
"reboot_internet": {
"name": "herstart_internet",
"description": "Herstart het internetmodem"
}
}
}

0 comments on commit 1fbf3d7

Please sign in to comment.