diff --git a/README.md b/README.md index 8c389a2..beaf9fa 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 (https://github.com/saniho/apiFreeBox). 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) diff --git a/custom_components/apiFreebox/const.py b/custom_components/apiFreebox/const.py index e46d4de..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.2.0" # attention updater aussi manifest.json +__VERSION__ = "1.0.4.0" # attention updater aussi manifest.json diff --git a/custom_components/apiFreebox/manifest.json b/custom_components/apiFreebox/manifest.json index f522b7d..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.2.0", + "version": "1.0.4.0", "requirements": [ ], "dependencies": [], diff --git a/custom_components/apiFreebox/sensor.py b/custom_components/apiFreebox/sensor.py index 4bd294b..6fe8d65 100644 --- a/custom_components/apiFreebox/sensor.py +++ b/custom_components/apiFreebox/sensor.py @@ -237,40 +237,52 @@ 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é" + elif (quelPackage == "com.max.play"): + chaine = "Max" + 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: ""}