From d9514b34b157afad82d173a42385681da8b5661f Mon Sep 17 00:00:00 2001 From: Lucas van der Have Date: Thu, 2 Mar 2023 21:35:54 +0100 Subject: [PATCH] feat: more translations, fix for volume and application_opened trigger --- .homeychangelog.json | 12 ++ .homeycompose/app.json | 2 +- .../capabilities/measure_volume.json | 18 ++ .homeycompose/capabilities/volume.json | 14 -- .homeycompose/flow/actions/send_key.json | 38 ++++ .../flow/triggers/application_opened.json | 2 +- app.json | 65 ++++++- app.ts | 21 +++ assets/capabilities/measure_volume.svg | 1 + drivers/remote/device.ts | 172 ++++++++++++++++-- drivers/remote/driver.compose.json | 13 +- drivers/remote/driver.ts | 15 +- locales/da.json | 39 ++++ locales/de.json | 39 ++++ locales/en.json | 30 +-- locales/es.json | 39 ++++ locales/fr.json | 39 ++++ locales/it.json | 39 ++++ locales/nl.json | 39 ++++ locales/no.json | 39 ++++ locales/pl.json | 39 ++++ locales/sv.json | 39 ++++ package.json | 2 +- remote.ts | 1 - 24 files changed, 705 insertions(+), 52 deletions(-) create mode 100644 .homeycompose/capabilities/measure_volume.json delete mode 100644 .homeycompose/capabilities/volume.json create mode 100644 .homeycompose/flow/actions/send_key.json create mode 100644 assets/capabilities/measure_volume.svg create mode 100644 locales/da.json create mode 100644 locales/de.json create mode 100644 locales/es.json create mode 100644 locales/fr.json create mode 100644 locales/it.json create mode 100644 locales/nl.json create mode 100644 locales/no.json create mode 100644 locales/pl.json create mode 100644 locales/sv.json diff --git a/.homeychangelog.json b/.homeychangelog.json index 3b58adb9..62caaade 100644 --- a/.homeychangelog.json +++ b/.homeychangelog.json @@ -34,5 +34,17 @@ "es": "Corregir el enlace incorrecto a la documentación de emparejamiento", "da": "Fix forkert link til paringsdokumentation", "pl": "Napraw nieprawidłowe połączenie do dokumentacji parowania" + }, + "0.3.0": { + "en": "Fix for volume buttons, more translations and added initial \"application opened\" flow card trigger", + "nl": "Fix voor volume knoppen, meer vertalingen en eerste versie van flow kaart \"applicatie geopend\" toegevoegd", + "de": "Fix für Lautstärketasten, mehr Übersetzungen und Auslöser für die initiale \"Anwendung geöffnet\"-Flow-Karte hinzugefügt", + "fr": "Correction pour les boutons de volume, plus de traductions et ajout de la gâchette initiale de la carte de flux \"application ouverte\"", + "it": "Correzione per i pulsanti del volume, più traduzioni e aggiunta del trigger della carta di flusso \"applicazione aperta\" iniziale", + "sv": "Fix för volymknappar, fler översättningar och tillagd initial \"applikation öppnad\"-flödeskortsutlösare", + "no": "Fikset for volumknapper, flere oversettelser og lagt til utløser for den initielle \"applikasjonsåpnet\"-flytkortet", + "es": "Corrección para los botones de volumen, más traducciones y añadido el desencadenante de la tarjeta de flujo inicial \"aplicación abierta\"", + "da": "Fix til volumenknapper, flere oversættelser og tilføjet initial \"applikation åbnet\" flow-kort udløser", + "pl": "Poprawka dla przycisków głośności, więcej tłumaczeń i dodano początkowy wyzwalacz karty przepływu \"otwarta aplikacja\"" } } diff --git a/.homeycompose/app.json b/.homeycompose/app.json index 48733877..328abcb0 100644 --- a/.homeycompose/app.json +++ b/.homeycompose/app.json @@ -1,6 +1,6 @@ { "id": "codes.lucasvdh.android-tv", - "version": "0.2.1", + "version": "0.3.0", "compatibility": ">=5.0.0", "sdk": 3, "brandColor": "#3DDC84", diff --git a/.homeycompose/capabilities/measure_volume.json b/.homeycompose/capabilities/measure_volume.json new file mode 100644 index 00000000..629b3d4f --- /dev/null +++ b/.homeycompose/capabilities/measure_volume.json @@ -0,0 +1,18 @@ +{ + "type": "number", + "title": { + "en": "Volume", + "nl": "Volume" + }, + "icon": "/assets/capabilities/measure_volume.svg", + "uiComponent": "sensor", + "getable": true, + "setable": false, + "units": { + "en": "%" + }, + "decimals": 0, + "min": 0, + "max": 100, + "step": 1.0 +} \ No newline at end of file diff --git a/.homeycompose/capabilities/volume.json b/.homeycompose/capabilities/volume.json deleted file mode 100644 index d241c1e0..00000000 --- a/.homeycompose/capabilities/volume.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type": "number", - "title": { - "en": "Volume", - "nl": "Volume" - }, - "uiComponent": "slider", - "getable": true, - "setable": false, - "uiQuickAction": true, - "min": 0, - "max": 15, - "step": 1 -} \ No newline at end of file diff --git a/.homeycompose/flow/actions/send_key.json b/.homeycompose/flow/actions/send_key.json new file mode 100644 index 00000000..54a85771 --- /dev/null +++ b/.homeycompose/flow/actions/send_key.json @@ -0,0 +1,38 @@ +{ + "id": "send_key", + "title": { + "en": "Send a key", + "nl": "Stuur een knop", + "de": "Sende eine Taste", + "fr": "Envoyer une touche", + "it": "Invia un tasto", + "sv": "Skicka en tangent", + "no": "Send en tast", + "es": "Enviar una tecla", + "da": "Send en tast", + "pl": "Wyślij klawisz" + }, + "titleFormatted": { + "en": "Send key [[option]]", + "nl": "Stuur knop [[option]]", + "de": "Sende Taste [[option]]", + "fr": "Envoyer la touche [[option]]", + "it": "Invia tasto [[option]]", + "sv": "Skicka tangent [[option]]", + "no": "Send tast [[option]]", + "es": "Enviar tecla [[option]]", + "da": "Send tast [[option]]", + "pl": "Wyślij klawisz [[option]]" + }, + "args": [ + { + "name": "device", + "type": "device", + "filter": "driver_id=remote" + }, + { + "name": "option", + "type": "autocomplete" + } + ] +} \ No newline at end of file diff --git a/.homeycompose/flow/triggers/application_opened.json b/.homeycompose/flow/triggers/application_opened.json index 6723824c..cecf21a4 100644 --- a/.homeycompose/flow/triggers/application_opened.json +++ b/.homeycompose/flow/triggers/application_opened.json @@ -35,7 +35,7 @@ { "name": "device", "type": "device", - "filter": "driver_id=philips-jointspace" + "filter": "driver_id=remote" } ] } \ No newline at end of file diff --git a/app.json b/app.json index 81a3badd..92d9adca 100644 --- a/app.json +++ b/app.json @@ -145,7 +145,7 @@ { "name": "device", "type": "device", - "filter": "driver_id=philips-jointspace" + "filter": "driver_id=remote" } ] } @@ -283,13 +283,60 @@ ] } ] + }, + { + "id": "send_key", + "title": { + "en": "Send a key", + "nl": "Stuur een knop", + "de": "Sende eine Taste", + "fr": "Envoyer une touche", + "it": "Invia un tasto", + "sv": "Skicka en tangent", + "no": "Send en tast", + "es": "Enviar una tecla", + "da": "Send en tast", + "pl": "Wyślij klawisz" + }, + "titleFormatted": { + "en": "Send key [[option]]", + "nl": "Stuur knop [[option]]", + "de": "Sende Taste [[option]]", + "fr": "Envoyer la touche [[option]]", + "it": "Invia tasto [[option]]", + "sv": "Skicka tangent [[option]]", + "no": "Send tast [[option]]", + "es": "Enviar tecla [[option]]", + "da": "Send tast [[option]]", + "pl": "Wyślij klawisz [[option]]" + }, + "args": [ + { + "name": "device", + "type": "device", + "filter": "driver_id=remote" + }, + { + "name": "option", + "type": "autocomplete" + } + ] } ] }, "drivers": [ { "name": { - "en": "Remote" + "en": "Remote", + "nl": "Afstandsbediening", + "de": "Fernbedienung", + "fr": "Télécommande", + "it": "Telecomando", + "sv": "Fjärrkontroll", + "no": "Fjernkontroll", + "es": "Control remoto", + "da": "Fjernbetjening", + "pl": "Pilot zdalnego sterowania" }, "pair": [ { @@ -376,7 +423,7 @@ "discovery": "googlecast", "capabilities": [ "onoff", - "volume", + "measure_volume", "volume_up", "volume_down", "volume_mute", @@ -654,18 +701,22 @@ "uiQuickAction": true, "icon": "assets/capabilities/watch_tv.svg" }, - "volume": { + "measure_volume": { "type": "number", "title": { "en": "Volume", "nl": "Volume" }, - "uiComponent": "slider", + "icon": "/assets/capabilities/measure_volume.svg", + "uiComponent": "sensor", "getable": true, "setable": false, - "uiQuickAction": true, + "units": { + "en": "%" + }, + "decimals": 0, "min": 0, - "max": 15, + "max": 100, "step": 1 } }, diff --git a/app.ts b/app.ts index 2671bf3d..5a25b457 100644 --- a/app.ts +++ b/app.ts @@ -26,6 +26,10 @@ class AndroidTV extends Homey.App { this.homey.flow.getActionCard('select_source') .registerRunListener(this.onFlowActionSelectSource) + this.homey.flow.getActionCard('send_key') + .registerRunListener(this.onFlowActionSendKey) + .registerArgumentAutocompleteListener('option', this.onFlowKeyAutocomplete.bind(this)) + // this.homey.flow.getActionCard('send_key') // .registerRunListener(this.onFlowActionSendKey) // .registerArgumentAutocompleteListener('option', this.onFlowKeyAutocomplete.bind(this)) @@ -46,6 +50,23 @@ class AndroidTV extends Homey.App { return device.openApplication(app) } + async onFlowActionSendKey({device, option}: { device: RemoteDevice, option: { key: string } }) { + return device.sendKey(option.key) + } + + async onFlowKeyAutocomplete(query: string, {device}: { device: RemoteDevice }): Promise { + return (await device.getKeys()) + .map(key => { + return { + 'id': key.key, + 'key': key.key, + 'name': key.name + } + }).filter(result => { + return result.name.toLowerCase().indexOf(query.toLowerCase()) > -1 + }) + } + async onFlowApplicationAutocomplete(query: string, {device}: { device: RemoteDevice }): Promise { return [ { diff --git a/assets/capabilities/measure_volume.svg b/assets/capabilities/measure_volume.svg new file mode 100644 index 00000000..e261a166 --- /dev/null +++ b/assets/capabilities/measure_volume.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/drivers/remote/device.ts b/drivers/remote/device.ts index dceb85ac..4c9e2baa 100644 --- a/drivers/remote/device.ts +++ b/drivers/remote/device.ts @@ -1,7 +1,10 @@ import {Remote} from "../../remote"; import {DeviceData, DeviceSettings, SettingsInput} from "./types"; -import AndroidTVRemoteClient, {Volume, Input} from "./client"; +import AndroidTVRemoteClient, {Input, Volume} from "./client"; +/** + * @property {RemoteDriver} driver + */ class RemoteDevice extends Remote { private client?: AndroidTVRemoteClient; private keyCapabilities: Array = [ @@ -86,17 +89,17 @@ class RemoteDevice extends Remote { this.log('volume', volume); this.log("Volume : " + volume.level + '/' + volume.maximum + " | Muted : " + volume.muted); + // await this.setCapabilityValue('volume_mute', volume.muted); + // await this.setCapabilityValue('volume', volume.level); await this.setCapabilityValue('volume_mute', volume.muted); - await this.setCapabilityValue('volume', volume.level); - await this.setCapabilityOptions('volume', { - min: 0, - max: volume.maximum, - step: 1.0 - }) + await this.setCapabilityValue('measure_volume', Math.round(volume.level / (volume.maximum / 100))); }); this.client.on('current_app', (current_app) => { - // this.setCapabilityValue('current_application', current_app); + // @ts-ignore + return this.driver.triggerApplicationOpenedTrigger(this, { + app: current_app + }).catch(this.error) }); this.client.on('unpaired', async () => { @@ -107,7 +110,8 @@ class RemoteDevice extends Remote { await this.setUnavailable(this.homey.__('error.unpaired')); }); - this.client.on('error', async () => { + this.client.on('error', async (error) => { + this.log('client.on(error)', error); // TODO: is this necessary? await this.reloadClient(60); }); @@ -122,6 +126,18 @@ class RemoteDevice extends Remote { return this.onCapabilityOnOffSet(value) }) + this.registerCapabilityListener('volume_up', value => { + return this.client?.volumeUp(); + }) + + this.registerCapabilityListener('volume_down', value => { + return this.client?.volumeDown(); + }) + + this.registerCapabilityListener('volume_mute', value => { + return this.client?.mute(); + }) + // this.registerCapabilityListener('key', value => { // return this._onCapabilityAmbilightModeSet(value) // }) @@ -224,10 +240,14 @@ class RemoteDevice extends Remote { // } } - fixCapabilities () { + fixCapabilities() { + let oldCapabilities = [ + 'volume' + ]; + let newCapabilities = [ "onoff", - "volume", + "measure_volume", "volume_up", "volume_down", "volume_mute", @@ -246,12 +266,27 @@ class RemoteDevice extends Remote { "key_watch_tv" ] + for (let i in oldCapabilities) { + let oldCapability = oldCapabilities[i] + + if (this.hasCapability(oldCapability)) { + this.log('Removing old capability: ' + oldCapability) + this.removeCapability(oldCapability) + .catch(error => { + this.log(error); + }) + } + } + for (let i in newCapabilities) { let newCapability = newCapabilities[i] if (!this.hasCapability(newCapability)) { - this.log('Fixed capability: ' + newCapability) + this.log('Adding new capability: ' + newCapability) this.addCapability(newCapability) + .catch(error => { + this.log(error); + }) } } } @@ -282,7 +317,45 @@ class RemoteDevice extends Remote { } } - public async openApplication(app: { url: string}): Promise { + public async sendKey(key: string): Promise { + if (key === 'key_stop') { + this.client?.sendKeyMediaStop(); + } else if (key === 'key_play') { + this.client?.sendKeyMediaPlay(); + } else if (key === 'key_pause') { + this.client?.sendKeyMediaPause(); + } else if (key === 'key_rewind') { + this.client?.sendKeyMediaRewind(); + } else if (key === 'key_fast_forward') { + this.client?.sendKeyMediaFastForward(); + } else if (key === 'key_source') { + this.client?.sendKeySource(); + } else if (key === 'key_watch_tv') { + this.client?.sendKeyTv(); + } else if (key === 'key_confirm') { + this.client?.sendKeyDpadCenter(); + } else if (key === 'key_previous') { + this.client?.sendKeyMediaStop(); + } else if (key === 'key_next') { + this.client?.sendKeyMediaNext(); + } else if (key === 'key_cursor_left') { + this.client?.sendKeyDpadLeft(); + } else if (key === 'key_cursor_up') { + this.client?.sendKeyDpadUp(); + } else if (key === 'key_cursor_right') { + this.client?.sendKeyDpadRight(); + } else if (key === 'key_cursor_down') { + this.client?.sendKeyDpadDown(); + } else if (key === 'key_options') { + this.client?.sendKeyMenu(); + } else if (key === 'key_back') { + this.client?.sendKeyBack(); + } else if (key === 'key_home') { + this.client?.sendKeyHome(); + } + } + + public async openApplication(app: { url: string }): Promise { this.client?.openApplication(app.url); } @@ -309,6 +382,79 @@ class RemoteDevice extends Remote { throw new Error(`Unknown source: ${source}`) } } + + public async getKeys(): Promise> { + return [ + { + key: 'key_stop', + name: this.homey.__(`key.stop`) + }, + { + key: 'key_play', + name: this.homey.__(`key.play`) + }, + { + key: 'key_pause', + name: this.homey.__(`key.pause`) + }, + { + key: 'key_rewind', + name: this.homey.__(`key.rewind`) + }, + { + key: 'key_fast_forward', + name: this.homey.__(`key.fast_forward`) + }, + { + key: 'key_source', + name: this.homey.__(`key.source`) + }, + { + key: 'key_watch_tv', + name: this.homey.__(`key.watch_tv`) + }, + { + key: 'key_confirm', + name: this.homey.__(`key.confirm`) + }, + { + key: 'key_previous', + name: this.homey.__(`key.previous`) + }, + { + key: 'key_next', + name: this.homey.__(`key.next`) + }, + { + key: 'key_cursor_left', + name: this.homey.__(`key.cursor_left`) + }, + { + key: 'key_cursor_up', + name: this.homey.__(`key.cursor_up`) + }, + { + key: 'key_cursor_right', + name: this.homey.__(`key.cursor_right`) + }, + { + key: 'key_cursor_down', + name: this.homey.__(`key.cursor_down`) + }, + { + key: 'key_options', + name: this.homey.__(`key.options`) + }, + { + key: 'key_back', + name: this.homey.__(`key.back`) + }, + { + key: 'key_home', + name: this.homey.__(`key.home`) + }, + ]; + } } module.exports = RemoteDevice; diff --git a/drivers/remote/driver.compose.json b/drivers/remote/driver.compose.json index 1fb2e183..bdd994a9 100644 --- a/drivers/remote/driver.compose.json +++ b/drivers/remote/driver.compose.json @@ -1,6 +1,15 @@ { "name": { - "en": "Remote" + "en": "Remote", + "nl": "Afstandsbediening", + "de": "Fernbedienung", + "fr": "Télécommande", + "it": "Telecomando", + "sv": "Fjärrkontroll", + "no": "Fjernkontroll", + "es": "Control remoto", + "da": "Fjernbetjening", + "pl": "Pilot zdalnego sterowania" }, "pair": [ { @@ -87,7 +96,7 @@ "discovery": "googlecast", "capabilities": [ "onoff", - "volume", + "measure_volume", "volume_up", "volume_down", "volume_mute", diff --git a/drivers/remote/driver.ts b/drivers/remote/driver.ts index c8fb9b2d..cf37ba70 100644 --- a/drivers/remote/driver.ts +++ b/drivers/remote/driver.ts @@ -1,11 +1,16 @@ -import {Device, DiscoveryResultMAC, DiscoveryResultMDNSSD, DiscoveryResultSSDP, DiscoveryStrategy, Driver} from "homey"; +import {Device, DiscoveryResultMAC, DiscoveryResultMDNSSD, DiscoveryResultSSDP, DiscoveryStrategy, Driver, FlowCardTriggerDevice} from "homey"; import AndroidTVRemoteClient from "./client"; import {Device as DeviceType} from "./types"; +import RemoteDevice from "./device"; class RemoteDriver extends Driver { + private applicationOpenedTrigger: FlowCardTriggerDevice | undefined; async onInit(): Promise { this.log("Driver has been initialised"); + + await this.registerFlowCards() + this.log('Flow cards have been initialized') } async onPair(session: any): Promise { @@ -146,6 +151,14 @@ class RemoteDriver extends Driver { .filter(device => device !== null) .map(discoveryResult => discoveryResult as DeviceType); } + + private async registerFlowCards() { + this.applicationOpenedTrigger = this.homey.flow.getDeviceTriggerCard('application_opened') + } + + private triggerApplicationOpenedTrigger (device: RemoteDevice, args: { app: string }) { + return this.applicationOpenedTrigger?.trigger(device, args) + } } module.exports = RemoteDriver; diff --git a/locales/da.json b/locales/da.json new file mode 100644 index 00000000..2a041bf1 --- /dev/null +++ b/locales/da.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Tilføj manuelt", + "ip": "IP-adresse", + "no_new_devices_hint": "Alle fundne TV'er er allerede tilføjet. Prøv at tilføje dit TV manuelt.", + "need_help_pairing": "Har du brug for hjælp til paring?", + "click_here_documentation": "Klik her for at se dokumentationen." + }, + "add_device": { + "title": "Tilføj enhed" + } + }, + "error": { + "generic": "Der opstod en uventet fejl", + "unpaired": "Enheden blev ikke parret og skal parres igen", + "device_not_found": "Enhed ikke fundet", + "something_went_wrong": "Noget gik galt" + }, + "key": { + "stop": "Stop", + "play": "Afspil", + "pause": "Pause", + "rewind": "Spol tilbage", + "fast_forward": "Spol fremad", + "source": "Kilde", + "watch_tv": "Se TV", + "confirm": "Bekræft", + "previous": "Forrige", + "next": "Næste", + "cursor_left": "Venstre pil", + "cursor_up": "Opad pil", + "cursor_right": "Højre pil", + "cursor_down": "Nedad pil", + "options": "Indstillinger", + "back": "Tilbage", + "home": "Hjem" + } +} \ No newline at end of file diff --git a/locales/de.json b/locales/de.json new file mode 100644 index 00000000..9c1bc336 --- /dev/null +++ b/locales/de.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Manuell hinzufügen", + "ip": "IP-Adresse", + "no_new_devices_hint": "Alle gefundenen Fernseher wurden bereits hinzugefügt. Versuchen Sie, Ihren Fernseher manuell hinzuzufügen.", + "need_help_pairing": "Brauchen Sie Hilfe bei der Kopplung?", + "click_here_documentation": "Klicken Sie hier, um die Dokumentation anzuzeigen." + }, + "add_device": { + "title": "Gerät hinzufügen" + } + }, + "error": { + "generic": "Ein unerwarteter Fehler ist aufgetreten", + "unpaired": "Das Gerät wurde entkoppelt und muss erneut gekoppelt werden", + "device_not_found": "Gerät nicht gefunden", + "something_went_wrong": "Etwas ist schiefgelaufen" + }, + "key": { + "stop": "Stoppen", + "play": "Abspielen", + "pause": "Pause", + "rewind": "Zurückspulen", + "fast_forward": "Vorspulen", + "source": "Quelle", + "watch_tv": "Fernsehen", + "confirm": "Bestätigen", + "previous": "Zurück", + "next": "Weiter", + "cursor_left": "D-Pad links", + "cursor_up": "D-Pad hoch", + "cursor_right": "D-Pad rechts", + "cursor_down": "D-Pad runter", + "options": "Optionen", + "back": "Zurück", + "home": "Home" + } +} diff --git a/locales/en.json b/locales/en.json index 4a227fc5..99123865 100644 --- a/locales/en.json +++ b/locales/en.json @@ -7,17 +7,6 @@ "need_help_pairing": "Need help pairing?", "click_here_documentation": "Click here to view the documentation." }, - "authenticate": { - "intro": "Enter the code displayed on the TV", - "submit": "Submit" - }, - "verify": { - "verifying": "Verifying Wake-on-LAN configuration...", - "verified": "Wake-on-LAN is enabled and working correctly!", - "errorTitle": "Could not verify WOL", - "errorDescription": "The on/off behavior of the TV may not work as expected if Wake-on-LAN is not enabled.
When your TV is put in standby mode, you can control it for about 10 minutes before it is fully turned off. Without Wake-on-LAN, there is no way to turn your TV back on after this.", - "confirm": "Understood" - }, "add_device": { "title": "Add Device" } @@ -27,5 +16,24 @@ "unpaired": "The device was un-paired and needs to be re-paired", "device_not_found": "Device not found", "something_went_wrong": "Something went wrong" + }, + "key": { + "stop": "Stop", + "play": "Play", + "pause": "Pause", + "rewind": "Rewind", + "fast_forward": "Fast forward", + "source": "Source", + "watch_tv": "Watch TV", + "confirm": "Confirm", + "previous": "Previous", + "next": "Next", + "cursor_left": "D-pad left", + "cursor_up": "D-pad up", + "cursor_right": "D-pad right", + "cursor_down": "D-pad down", + "options": "Options", + "back": "Back", + "home": "Home" } } \ No newline at end of file diff --git a/locales/es.json b/locales/es.json new file mode 100644 index 00000000..9a09d088 --- /dev/null +++ b/locales/es.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Agregar manualmente", + "ip": "Dirección IP", + "no_new_devices_hint": "Todos los televisores encontrados ya están agregados. Intenta agregar tu televisor manualmente.", + "need_help_pairing": "¿Necesitas ayuda para emparejar?", + "click_here_documentation": "Haz clic aquí para ver la documentación." + }, + "add_device": { + "title": "Agregar dispositivo" + } + }, + "error": { + "generic": "Ocurrió un error inesperado", + "unpaired": "El dispositivo no está emparejado y debe volver a emparejarse", + "device_not_found": "Dispositivo no encontrado", + "something_went_wrong": "Algo salió mal" + }, + "key": { + "stop": "Detener", + "play": "Reproducir", + "pause": "Pausar", + "rewind": "Retroceder", + "fast_forward": "Avanzar rápido", + "source": "Fuente", + "watch_tv": "Ver TV", + "confirm": "Confirmar", + "previous": "Anterior", + "next": "Siguiente", + "cursor_left": "Izquierda", + "cursor_up": "Arriba", + "cursor_right": "Derecha", + "cursor_down": "Abajo", + "options": "Opciones", + "back": "Atrás", + "home": "Inicio" + } +} diff --git a/locales/fr.json b/locales/fr.json new file mode 100644 index 00000000..bc9c97ee --- /dev/null +++ b/locales/fr.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Ajouter manuellement", + "ip": "Adresse IP", + "no_new_devices_hint": "Toutes les télévisions trouvées sont déjà ajoutées. Essayez d'ajouter votre télévision manuellement.", + "need_help_pairing": "Besoin d'aide pour le couplage?", + "click_here_documentation": "Cliquez ici pour voir la documentation." + }, + "add_device": { + "title": "Ajouter un appareil" + } + }, + "error": { + "generic": "Une erreur inattendue s'est produite", + "unpaired": "L'appareil a été désapparié et doit être réapparié", + "device_not_found": "Appareil non trouvé", + "something_went_wrong": "Quelque chose s'est mal passé" + }, + "key": { + "stop": "Arrêter", + "play": "Lire", + "pause": "Pause", + "rewind": "Rembobiner", + "fast_forward": "Avance rapide", + "source": "Source", + "watch_tv": "Regarder la télévision", + "confirm": "Confirmer", + "previous": "Précédent", + "next": "Suivant", + "cursor_left": "Flèche gauche", + "cursor_up": "Flèche haut", + "cursor_right": "Flèche droite", + "cursor_down": "Flèche bas", + "options": "Options", + "back": "Retour", + "home": "Accueil" + } +} diff --git a/locales/it.json b/locales/it.json new file mode 100644 index 00000000..085b74c5 --- /dev/null +++ b/locales/it.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Aggiungi manualmente", + "ip": "Indirizzo IP", + "no_new_devices_hint": "Tutti i televisori trovati sono già stati aggiunti. Prova ad aggiungere il tuo televisore manualmente.", + "need_help_pairing": "Hai bisogno di aiuto per l'abbinamento?", + "click_here_documentation": "Clicca qui per visualizzare la documentazione." + }, + "add_device": { + "title": "Aggiungi dispositivo" + } + }, + "error": { + "generic": "Si è verificato un errore imprevisto", + "unpaired": "Il dispositivo è stato scollegato e deve essere ricollegato", + "device_not_found": "Dispositivo non trovato", + "something_went_wrong": "Qualcosa è andato storto" + }, + "key": { + "stop": "Stop", + "play": "Play", + "pause": "Pausa", + "rewind": "Riavvolgi", + "fast_forward": "Avanzamento rapido", + "source": "Sorgente", + "watch_tv": "Guarda la TV", + "confirm": "Conferma", + "previous": "Precedente", + "next": "Successivo", + "cursor_left": "Freccia sinistra", + "cursor_up": "Freccia su", + "cursor_right": "Freccia destra", + "cursor_down": "Freccia giù", + "options": "Opzioni", + "back": "Indietro", + "home": "Home" + } +} diff --git a/locales/nl.json b/locales/nl.json new file mode 100644 index 00000000..693283a9 --- /dev/null +++ b/locales/nl.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Handmatig toevoegen", + "ip": "IP-adres", + "no_new_devices_hint": "Alle gevonden televisies zijn al toegevoegd. Probeer je tv handmatig toe te voegen.", + "need_help_pairing": "Hulp nodig bij koppelen?", + "click_here_documentation": "Klik hier om de documentatie te bekijken." + }, + "add_device": { + "title": "Apparaat toevoegen" + } + }, + "error": { + "generic": "Er is een onverwachte fout opgetreden", + "unpaired": "Het apparaat is ontkoppeld en moet opnieuw worden gekoppeld", + "device_not_found": "Apparaat niet gevonden", + "something_went_wrong": "Er is iets misgegaan" + }, + "key": { + "stop": "Stoppen", + "play": "Afspelen", + "pause": "Pauzeren", + "rewind": "Terugspoelen", + "fast_forward": "Vooruitspoelen", + "source": "Bron", + "watch_tv": "TV kijken", + "confirm": "Bevestigen", + "previous": "Vorige", + "next": "Volgende", + "cursor_left": "D-pad links", + "cursor_up": "D-pad omhoog", + "cursor_right": "D-pad rechts", + "cursor_down": "D-pad omlaag", + "options": "Opties", + "back": "Terug", + "home": "Start" + } +} diff --git a/locales/no.json b/locales/no.json new file mode 100644 index 00000000..d702e7c8 --- /dev/null +++ b/locales/no.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Legg til manuelt", + "ip": "IP-adresse", + "no_new_devices_hint": "Alle tilgjengelige TV-er er allerede lagt til. Prøv å legge til TV-en manuelt.", + "need_help_pairing": "Trenger hjelp med sammenkobling?", + "click_here_documentation": "Klikk her for å se dokumentasjonen." + }, + "add_device": { + "title": "Legg til enhet" + } + }, + "error": { + "generic": "Det oppstod en uventet feil", + "unpaired": "Enheten er frakoblet og må kobles til på nytt", + "device_not_found": "Enhet ikke funnet", + "something_went_wrong": "Noe gikk galt" + }, + "key": { + "stop": "Stopp", + "play": "Spill", + "pause": "Pause", + "rewind": "Spol tilbake", + "fast_forward": "Spol fremover", + "source": "Kilde", + "watch_tv": "Se på TV", + "confirm": "Bekreft", + "previous": "Forrige", + "next": "Neste", + "cursor_left": "Pil venstre", + "cursor_up": "Pil opp", + "cursor_right": "Pil høyre", + "cursor_down": "Pil ned", + "options": "Alternativer", + "back": "Tilbake", + "home": "Hjem" + } +} \ No newline at end of file diff --git a/locales/pl.json b/locales/pl.json new file mode 100644 index 00000000..99c3dc9b --- /dev/null +++ b/locales/pl.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Dodaj ręcznie", + "ip": "Adres IP", + "no_new_devices_hint": "Wszystkie znalezione telewizory zostały już dodane. Spróbuj dodać swój telewizor ręcznie.", + "need_help_pairing": "Potrzebna pomoc w parowaniu?", + "click_here_documentation": "Kliknij tutaj, aby wyświetlić dokumentację." + }, + "add_device": { + "title": "Dodaj urządzenie" + } + }, + "error": { + "generic": "Wystąpił nieoczekiwany błąd", + "unpaired": "Urządzenie zostało odłączone i musi zostać ponownie sparowane", + "device_not_found": "Nie znaleziono urządzenia", + "something_went_wrong": "Coś poszło nie tak" + }, + "key": { + "stop": "Stop", + "play": "Odtwórz", + "pause": "Pauza", + "rewind": "Cofnij", + "fast_forward": "Szybkie przewijanie do przodu", + "source": "Źródło", + "watch_tv": "Oglądaj TV", + "confirm": "Potwierdź", + "previous": "Poprzedni", + "next": "Następny", + "cursor_left": "Kursor w lewo", + "cursor_up": "Kursor w górę", + "cursor_right": "Kursor w prawo", + "cursor_down": "Kursor w dół", + "options": "Opcje", + "back": "Powrót", + "home": "Strona główna" + } +} diff --git a/locales/sv.json b/locales/sv.json new file mode 100644 index 00000000..dc8c994c --- /dev/null +++ b/locales/sv.json @@ -0,0 +1,39 @@ +{ + "pair": { + "add_by_ip": { + "title": "Lägg till manuellt", + "ip": "IP-adress", + "no_new_devices_hint": "Alla hittade TV-apparater är redan tillagda. Försök att lägga till din TV manuellt.", + "need_help_pairing": "Behöver du hjälp med parning?", + "click_here_documentation": "Klicka här för att visa dokumentationen." + }, + "add_device": { + "title": "Lägg till enhet" + } + }, + "error": { + "generic": "Ett oväntat fel inträffade", + "unpaired": "Enheten är inte ihopparad och behöver ihopparas igen", + "device_not_found": "Enheten hittades inte", + "something_went_wrong": "Något gick fel" + }, + "key": { + "stop": "Stoppa", + "play": "Spela", + "pause": "Pausa", + "rewind": "Spola bakåt", + "fast_forward": "Spola framåt", + "source": "Källa", + "watch_tv": "Titta på TV", + "confirm": "Bekräfta", + "previous": "Föregående", + "next": "Nästa", + "cursor_left": "D-pad vänster", + "cursor_up": "D-pad upp", + "cursor_right": "D-pad höger", + "cursor_down": "D-pad ner", + "options": "Alternativ", + "back": "Tillbaka", + "home": "Hem" + } +} \ No newline at end of file diff --git a/package.json b/package.json index 4aca0cad..088c44e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codes.lucasvdh.android-tv", - "version": "0.2.1", + "version": "0.3.0", "main": "app.ts", "scripts": { "homey-validate": "homey app validate --level verified", diff --git a/remote.ts b/remote.ts index 0c3e7544..7ee38eac 100644 --- a/remote.ts +++ b/remote.ts @@ -1,7 +1,6 @@ import { Device } from "homey"; export class Remote extends Device { - async onInit(): Promise { this.log('Device has been initialized'); await this.setUnavailable();