Add translation example

This commit is contained in:
ludeeus 2019-07-20 10:52:12 +00:00
parent f2a65e77b6
commit 0037bb63fe
3 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,7 @@ File | Purpose
`.github/ISSUE_TEMPLATE/issue.md` | Template for issues
`.github/settings.yml` | Probot settings to control the repository settings.
`.vscode/taks.json` | Tasks for the devcontainer.
`custom_components/blueprint/.translations/sensor.nb.json` | [Translation files.](https://developers.home-assistant.io/docs/en/next/internationalization_custom_component_localization.html#translation-strings)
`custom_components/blueprint/__init__.py` | The component file for the integration.
`custom_components/blueprint/binary_sensor.py` | Binary sensor platform for the integration.
`custom_components/blueprint/const.py` | A file to hold shared variables/constants for the entire integration.

View File

@ -0,0 +1,5 @@
{
"state": {
"Some sample static text.": "Eksempel tekst."
}
}

View File

@ -29,7 +29,7 @@ class BlueprintSensor(Entity):
# Check the data and update the value.
if updated.get("static") is None:
self._state = self._status
self._state = self._state
else:
self._state = updated.get("static")