[WIP] Add Fido sensor#5997
Conversation
|
@titilambert, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @robbiet480 to be potential reviewers. |
There was a problem hiding this comment.
'pyfido.client.PyFidoError' imported but unused
pvizeli
left a comment
There was a problem hiding this comment.
Looks good. Only small minor changes
| self.fido_data = fido_data | ||
| self._state = None | ||
|
|
||
| self.update() |
There was a problem hiding this comment.
Remove that and use add_devices(sensors, True)
There was a problem hiding this comment.
Where can I find the definition of this function add_devices ?
| try: | ||
| self.client.fetch_data() | ||
| except PyFidoError as exp: | ||
| _LOGGER.error(exp) |
There was a problem hiding this comment.
use _LOGGER.exception and add a message to it.
| """Initialize the sensor.""" | ||
| self.client_name = name | ||
| self.type = sensor_type | ||
| self.entity_id = "sensor.{}_{}".format(name, sensor_type) |
There was a problem hiding this comment.
You don't need that. remove it.
There was a problem hiding this comment.
I just want to keep the same string between the sensor entity_id and the monitored_variables list
There was a problem hiding this comment.
That will be done. But if you setup same thing twice you disrate the core. So the core will produce your entity_id and make sure that is real unique
There was a problem hiding this comment.
Oki ! So I changed the name of some sensor to get something more consistent
|
|
||
| def setup_platform(hass, config, add_devices, discovery_info=None): | ||
| """Set up the Fido sensor.""" | ||
| # Create a data fetcher to support all of the configured sensors. Then make |
There was a problem hiding this comment.
Cleanup this comments. It should be clear.
pvizeli
left a comment
There was a problem hiding this comment.
Small cleanups and ready to go 👍
There was a problem hiding this comment.
This just bad all stuff ...
|
@pvizeli just missing the documentation, I will push it later today |
|
Merge after test pass. You can push your doc and refere to this. I can merge it without docu. |
|
It seems the docu was not merged or not there yet (thus the WIP?): |
|
😢 Added a doc stub. |
|
wtf ?! I'm doing it right now ! |
|
@balloob done here: home-assistant/home-assistant.io#2158 |
|
Our account uses 1 number to login but has 3 numbers associated to the account. Would you be able to add a config option for the phone number to get the data from? Right now it gets the data from the primary number only. Thanks. |
|
@tanilolli could you try the version 0.2.0 of pyfido: https://github.com/titilambert/pyfido Thanks |
|
@titilambert It works! I tested with all 3 numbers in the account and got the data I was expecting. Thank you very much! |
|
Nice ! I hope make the PR this week ! |
Description:
Get your current talk/text/data usage from your Fido (http://fido.ca) account
Pull request in home-assistant.github.io with documentation: home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml(if applicable):Checklist:
toxrun successfully. Your PR cannot be merged unless tests passREQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.