-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Hass: Add Translation of states list to value_template map and Notification Command Class first to use this #105
Conversation
Pull Request Test Coverage Report for Build 438698385
💛 - Coveralls |
lib/Gateway.js
Outdated
@@ -1528,7 +1530,7 @@ Gateway.prototype.discoverValue = function (node, vId) { | |||
if (valueId.list) { | |||
cfg.discovery_payload.value_template = getMappedStateTemplate( | |||
valueId.states, | |||
0 | |||
valueId.default ? valueId.default : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure I understood this correctly, IMO when the value is not in the map the value shown should be the one coming from json payload. Id this what's happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stand corrected. I did some nice patching on the payload, after manual testing
If valueId.default
is undefinied the default value of payload is the value_json.value
this way it really presents the value numeric or other on UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add notification part 1 * add translation from states to value_template * support both number and text * add motion sensor icon * add new icon for motion sensor * add TODO for icons. Add logic on mapped default value * patch default value, to show value_json.value when uknown mapping entry is posted * remove extra bracket * fix linting issues Co-authored-by: V. Aretakis <[email protected]>
Make Sensors of Notification CC provide translated values to Home assistant.
An example is Motion sensors. While the state is 0 or 8, this is not a nice to look into.
The real values per z-wave specification are idle and 'Motion detection'.
This patch converts the sensor values showin in HASS in human readable form.