From 3fc6b5f60d9e7cfae0abdccad9d8048a30e47297 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Fri, 10 Nov 2023 21:15:51 +0100 Subject: [PATCH 1/9] Update sensor.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nettoyage du code sur les chaine pour le rendre plus simple à mettre à jour. Ajout de plusieurs "chaines". Renommage de certaines chaines existantes en commençant leur nom par une majuscule. Si le package n'est pas traité, le chanel/chanel name comportent le nom du package pour afficher une info. --- custom_components/apiFreebox/sensor.py | 72 +++++++++++++++----------- 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/custom_components/apiFreebox/sensor.py b/custom_components/apiFreebox/sensor.py index 4bd294b..d610746 100644 --- a/custom_components/apiFreebox/sensor.py +++ b/custom_components/apiFreebox/sensor.py @@ -237,40 +237,50 @@ def _update(self): status_counts["channel"] = channel["channelNumber"] status_counts["channelName"] = channel["channelName"] status_counts["out"] = "tv" # on force - elif (quelPackage == "fr.freebox.mediaplayer"): - status_counts["out"] = "mediaplayer" - status_counts["channel"] = "mediaplayer" - status_counts["channelName"] = "mediaplayer" - elif (quelPackage == "fr.freebox.vodlauncher"): - status_counts["out"] = "vodlaucher" - status_counts["channel"] = "vodlaucher" - status_counts["channelName"] = "vodlaucher" - elif (quelPackage == "com.disneyplus"): - status_counts["out"] = "Disney +" - status_counts["channel"] = "Disney +" - status_counts["channelName"] = "Disney +" - elif (quelPackage == "com.netflix"): - status_counts["out"] = "Netflix" - status_counts["channel"] = "Netflix" - status_counts["channelName"] = "Netflix" - elif (quelPackage == "com.youtube.tv"): - status_counts["out"] = "youtube" - status_counts["channel"] = "youtube" - status_counts["channelName"] = "youtube" - elif (quelPackage == "com.primevideo"): - status_counts["out"] = "Prime" - status_counts["channel"] = "Prime" - status_counts["channelName"] = "Prime" - elif (quelPackage == "fr.freebox.home"): - status_counts["out"] = "home" - status_counts["channel"] = "home" - status_counts["channelName"] = "home" - else: - status_counts["out"] = "%s ???"%(quelPackage) + elif ( quelPackage == "fr.freebox.radio"): + channel = myfbx_player_status_details["foreground_app"]["context"]["radio"]["currentRadio"] + status_counts["channel"] = channel["name"] + status_counts["channelName"] = channel["name"] + status_counts["out"] = "Radio" # on force + else: + if (quelPackage == "fr.freebox.mediaplayer"): + chaine = "mediaplayer" + elif (quelPackage == "fr.freebox.vodlauncher"): + chaine = "vodlaucher" + elif (quelPackage == "com.disneyplus"): + chaine = "Disney +" + elif (quelPackage == "com.netflix"): + chaine = "Netflix" + elif (quelPackage == "com.youtube.tv"): + chaine = "Youtube" + elif (quelPackage == "com.primevideo"): + chaine = "Prime" + elif (quelPackage == "fr.freebox.home"): + chaine = "Home" + elif (quelPackage == "fr.freebox.overlayhome"): + chaine = "Home" + elif (quelPackage == "fr.freebox.replay"): + chaine = "Replay" + elif (quelPackage == "fr.freebox.filebrowser"): + chaine = "Mes Fichiers" + elif (quelPackage == "fr.freebox.ligue1"): + chaine = "Free Ligue 1" + elif (quelPackage == "fr.freebox.domotique"): + chaine = "Camera" + elif (quelPackage == "fr.freebox.downloader"): + chaine = "Téléchargements" + elif (quelPackage == "com.apple.tv"): + chaine = "Apple TV" + elif (quelPackage == "fr.freebox.nucleus"): + chaine = "Oqee Ciné" + else: + chaine = "%s ???"%(quelPackage) + status_counts["out"] = chaine + status_counts["channel"] = chaine + status_counts["channelName"] = chaine except: myfbx_player_status_details = {"power_state": "eteinte"} pass - status_counts["info"] = "%s"%(myfbx_player_status_details) self._attributes = {ATTR_ATTRIBUTION: ""} From 4a9935caec3297a5b653324b046e904616d648e6 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Fri, 10 Nov 2023 21:16:38 +0100 Subject: [PATCH 2/9] Update const.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit passage à la version 1.0.3.0 --- custom_components/apiFreebox/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/apiFreebox/const.py b/custom_components/apiFreebox/const.py index e46d4de..9612cd9 100644 --- a/custom_components/apiFreebox/const.py +++ b/custom_components/apiFreebox/const.py @@ -2,4 +2,4 @@ ISSUE_URL="https://github.com/saniho/apiFreebox/issues" -__VERSION__ = "1.0.2.0" # attention updater aussi manifest.json +__VERSION__ = "1.0.3.0" # attention updater aussi manifest.json From 246a1c8cab4c85fe8ead1d02c980a9d7ba3c442b Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Fri, 10 Nov 2023 21:17:23 +0100 Subject: [PATCH 3/9] Update manifest.json update to version 1.0.3.0 --- custom_components/apiFreebox/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/apiFreebox/manifest.json b/custom_components/apiFreebox/manifest.json index f522b7d..b2f0180 100644 --- a/custom_components/apiFreebox/manifest.json +++ b/custom_components/apiFreebox/manifest.json @@ -3,7 +3,7 @@ "name": "apiFreebox sensor", "documentation": "https://github.com/saniho/apiFreeBox/", "config_flow": false, - "version": "1.0.2.0", + "version": "1.0.3.0", "requirements": [ ], "dependencies": [], From c7f084dfb82887478c0e2c6be92d5bd784662e63 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sun, 24 Dec 2023 09:12:26 +0100 Subject: [PATCH 4/9] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c389a2..914ae21 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ freebox for HA ============== +Fork du travail de saniho qui n'a plus l'air maintenu. management simple de votre freebox et des freeplayer @@ -22,4 +23,4 @@ valider ensuite dans l'interface du serveur, l'acces au free player redemarrer, vous aurez ensuite les informations sur la freebox et les freeplayer -![picture](img/sensorFreebox.png) \ No newline at end of file +![picture](img/sensorFreebox.png) From 441ac36e45334ad889e6ba4644a03f8a10922744 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sun, 24 Dec 2023 09:13:02 +0100 Subject: [PATCH 5/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 914ae21..beaf9fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ freebox for HA ============== -Fork du travail de saniho qui n'a plus l'air maintenu. +Fork du travail de saniho qui n'a plus l'air maintenu (https://github.com/saniho/apiFreeBox). management simple de votre freebox et des freeplayer From 4bab1ce6cb58e28b45b177589216f34d33830f75 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sat, 24 Aug 2024 09:04:42 +0200 Subject: [PATCH 6/9] Update sensor.py Ajout de Max dans les chaines --- custom_components/apiFreebox/sensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/apiFreebox/sensor.py b/custom_components/apiFreebox/sensor.py index d610746..fe69b2b 100644 --- a/custom_components/apiFreebox/sensor.py +++ b/custom_components/apiFreebox/sensor.py @@ -273,6 +273,8 @@ def _update(self): chaine = "Apple TV" elif (quelPackage == "fr.freebox.nucleus"): chaine = "Oqee Ciné" + elif (quelPackage == "fr.max.play"): + chaine = "Max" else: chaine = "%s ???"%(quelPackage) status_counts["out"] = chaine From 74702a83821ef938a8b71b64d904fcd052b4a61a Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sat, 24 Aug 2024 09:14:17 +0200 Subject: [PATCH 7/9] Update manifest.json --- custom_components/apiFreebox/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/apiFreebox/manifest.json b/custom_components/apiFreebox/manifest.json index b2f0180..7d82fa1 100644 --- a/custom_components/apiFreebox/manifest.json +++ b/custom_components/apiFreebox/manifest.json @@ -3,7 +3,7 @@ "name": "apiFreebox sensor", "documentation": "https://github.com/saniho/apiFreeBox/", "config_flow": false, - "version": "1.0.3.0", + "version": "1.0.4.0", "requirements": [ ], "dependencies": [], From a75ecbcf6389ba0f6e76c9e6870fb639479af7a1 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sat, 24 Aug 2024 09:19:25 +0200 Subject: [PATCH 8/9] Update const.py --- custom_components/apiFreebox/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/apiFreebox/const.py b/custom_components/apiFreebox/const.py index 9612cd9..09f05d3 100644 --- a/custom_components/apiFreebox/const.py +++ b/custom_components/apiFreebox/const.py @@ -2,4 +2,4 @@ ISSUE_URL="https://github.com/saniho/apiFreebox/issues" -__VERSION__ = "1.0.3.0" # attention updater aussi manifest.json +__VERSION__ = "1.0.4.0" # attention updater aussi manifest.json From ed18696377b6efe7ab1be768d595a119bb83f346 Mon Sep 17 00:00:00 2001 From: tdelaux <44919953+tdelaux@users.noreply.github.com> Date: Sat, 24 Aug 2024 09:24:14 +0200 Subject: [PATCH 9/9] Update sensor.py Add Max Channel --- custom_components/apiFreebox/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/apiFreebox/sensor.py b/custom_components/apiFreebox/sensor.py index fe69b2b..6fe8d65 100644 --- a/custom_components/apiFreebox/sensor.py +++ b/custom_components/apiFreebox/sensor.py @@ -273,7 +273,7 @@ def _update(self): chaine = "Apple TV" elif (quelPackage == "fr.freebox.nucleus"): chaine = "Oqee Ciné" - elif (quelPackage == "fr.max.play"): + elif (quelPackage == "com.max.play"): chaine = "Max" else: chaine = "%s ???"%(quelPackage)