Add IBM Watson IoT Platform component#13664
Conversation
stevemar
left a comment
There was a problem hiding this comment.
i came here out of interest to check out @mtreinish's PR, stumbled upon a typo or two. Neat stuff.
|
Like it! |
There was a problem hiding this comment.
Why are you touching xiaomi_miio.py ?
There was a problem hiding this comment.
This was a rebase mistake, fixed in the next rev.
There was a problem hiding this comment.
You already defined defaults, no need to use get with default just use []
There was a problem hiding this comment.
CONF_ORG is required, use conf[CONF_ORG]
There was a problem hiding this comment.
You know I'm looking at this again, and I'm not sure what my intent was when I wrote this a month ago. False wouldn't make much sense because if we get a ValueError there _include_state will already be false. I can only assume I meant for it to be true, but I can't remember why. I'm just going to leave it as is, and if I remember what my intent was I'll add a comment here.
There was a problem hiding this comment.
Well I think that using exception handling to implement logic is not the best approach... maybe you can rework this part of the code into something more readable and less prone to confusion.
There was a problem hiding this comment.
Make 3 a constant declared in the beginning of the file
|
May I ask why you closed this? This was so close to being done 🏁 |
|
The latest revision reworks the logic around setting the device state in the output json to be a bit more clear to address @dgomes comments. |
|
|
||
| include = conf[CONF_INCLUDE] | ||
| exclude = conf[CONF_EXCLUDE] | ||
| whitelist_e = set(include.get(CONF_ENTITIES, [])) |
There was a problem hiding this comment.
The empty list default value is already set in the config schema. Don't use dict.get if there are defaults in place. Just use dict[key].
|
|
||
| client_args = { | ||
| 'org': conf[CONF_ORG], | ||
| 'type': conf.get(CONF_TYPE), |
There was a problem hiding this comment.
Don't use dict.get for required keys.
| self.gateway = gateway | ||
| self.gateway.connect() | ||
| self.event_to_json = event_to_json | ||
| self.max_tries = MAX_TRIES |
There was a problem hiding this comment.
You can use the constant directly. You don't need to store it in an instance attribute.
This commit adds a new history component for the IBM Watson IoT Platform. The IBM Watson IoT Platform allows for tracking of devices and analytics on top of the device data. This new component allows users to have home assistant automatically populate a watson iot platform board with device data from devices managed by home assistant.
|
Thanks for coming back and finishing :) |
* Add documentation for the new watson_iot component This commit adds documention for the new watson_iot component which was added in home-assistant/core#13664 It links to the official documentation for setting up the cloud service and generating the required auth information. * ✏️ Missing comma * Use configuration tags This commit updates the formatting of the configuration section of the documentation. Previously it manually formatted a list instead of leveraging the templating format. This corrects that oversight and uses the standard format. * 🎨 Adds logo * ⬆️ ha_release -> 0.68 * ✏️ Processed RFC's
* Add documentation for the new watson_iot component This commit adds documention for the new watson_iot component which was added in home-assistant/core#13664 It links to the official documentation for setting up the cloud service and generating the required auth information. * ✏️ Missing comma * Use configuration tags This commit updates the formatting of the configuration section of the documentation. Previously it manually formatted a list instead of leveraging the templating format. This corrects that oversight and uses the standard format. * 🎨 Adds logo * ⬆️ ha_release -> 0.68 * ✏️ Processed RFC's
|
it would be good to add more detail on a config example , as following the docs , the config fails in loading the component : -- |
|
@gnkarn hmm, that config looks valid can you please open an issue with the details including the error in the logs when the component fails to load. (there likely is a stack trace in the logs if it's erroring on load) I'll take a look at it as soon as I can once you open it, there might be a bug in the include/exclude configuration I didn't test that bit as thoroughly as the rest of the component. But from a quick glance nothing looks wrong with that. |
|
@mtreinish have you published anywhere the analysis you have performed on the Watson platform? |
|
@mtreinish there is nothing of help on the logs , as the configuration of the component : could not be loaded . |
|
No support in pull requests. Open an issue as requested. |
Description:
This commit adds a new history component for the IBM Watson IoT
Platform. The IBM Watson IoT Platform allows for tracking of devices
and analytics on top of the device data. This new component allows
users to have home assistant automatically populate a watson iot
platform board with device data from devices managed by home assistant.
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5100
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.