myTselection / youfone_be

Yoin.be Youfone.nl Home Assistant custom component HACS to get Yoin / Youfone mobile phone subscription and usage details for Belgium and Netherlands.
MIT License
3 stars 1 forks source link

Percentage, need to calculate? #4

Closed geertmeersman closed 1 year ago

geertmeersman commented 1 year ago

Something I noticed... But it's for sure not linked to the way you implemented it, but we can share some thoughts on it... For the Internet, the percentage calculation at Youfone side seems wrong. They indicate 5%, but I currently only used 54Mb of the 12288Mb. Are you sure the percentage value is refering to the used amount? But perhaps it's a calculation error at Youfone's side :-) image

myTselection commented 1 year ago

I noticed the same recently. It seems mainly an issue at start of a new period I believe. But I checked and this is the data shared by Youfone. Youfone is using this to show the progress bar/slider on their site. I might add my own percentage calculation. Will check on it, but currently mainly busy with dev on my other intergration (bibliotheek.be ;))

geertmeersman commented 1 year ago

No worries and no rush. Perhaps I'll modify it and send you the code .

And bibliotheek I saw indeed in your projects this week and also added it, will come in handy since my wife just got some books that she forgot about 😂

Op za 4 feb. 2023 20:41 schreef myT @.***>:

I noticed the same recently. It seems mainly an issue at start of a new period I believe. But I checked and this is the data shared by Youfone. Youfone is using this to show the progress bar/slider on their site. I might add my own percentage calculation. Will check on it, but currently mainly busy with dev on my other intergration (bibliotheek.be ;))

— Reply to this email directly, view it on GitHub https://github.com/myTselection/youfone_be/issues/4#issuecomment-1416834389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOCG623FOHCTGRWR7LOHETWV2WHVANCNFSM6AAAAAAURKD5WA . You are receiving this because you authored the thread.Message ID: @.***>

geertmeersman commented 1 year ago

Correction done and tested for both ComponentInternetSensor and ComponentMobileSensor

        self._used_percentage = round(int(self._includedvolume_usage)/int(self._total_volume.split(" ")[0]),2)

So feel free to add it whenever you have time :-)

image

myTselection commented 1 year ago

added a multiply with 100 since it's already expected to be a percentage. Fixed since R1.2.1. Thanks for your support again Geert!