Skip to content

Commit b0dada4

Browse files
committed
fix value type and genre mapping to string
1 parent c83c195 commit b0dada4

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Fix scene values type 'list' (Partially fix #266) #267
3434
add support for SmartOS #272
3535

3636
# 1.6.0
37-
Fix broken Node 12 builds (v8 7.4.xxx)
38-
Initial support for OpenZWave 1.6
37+
Fix broken Node 12 builds (v8 7.4.xxx) #302
38+
Initial support for OpenZWave 1.6 #300
3939
- implement exception macros
4040
- [deprecate several legacy OpenZWave calls](https://github.com/OpenZWave/open-zwave/wiki/OpenZWave-1.6-Release-Notes#deprecated-featuresmethods)
4141
Updated Raspbian Readme to fix bug when installing on Raspbian stretch #271

binding.gyp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
"OPENZWAVE_DOC=<!@(node -p -e \"'<(OZW_DOC)'.length ? '<(OZW_DOC)' : '/usr/local/share/doc/openzwave'\")",
5757
"OPENZWAVE_SECURITY=<!@(find <(OZW_INC) -name ZWSecurity.h | wc -l)",
5858
"OPENZWAVE_EXCEPTIONS=<!@(find <(OZW_INC) -name OZWException.h | wc -l)",
59-
"OPENZWAVE_BITSET=<!@(find <(OZW_INC) -name ValueBitSet.h | wc -l)"
59+
"OPENZWAVE_BITSET=<!@(find <(OZW_INC) -name ValueBitSet.h | wc -l)",
60+
"OPENZWAVE_VALUETYPE_FROM_ENUM=<!@(ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::Value::GetTypeNameFromEnum | wc -l)",
61+
"OPENZWAVE_VALUETYPE_FROM_VALUEID=<!@(ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::ValueID::GetTypeAsString | wc -l)",
6062
],
6163
"link_settings": {
6264
"libraries": [
@@ -89,6 +91,8 @@
8991
"OPENZWAVE_SECURITY=<!@(find <(OZW_INC) -name ZWSecurity.h | wc -l)",
9092
"OPENZWAVE_EXCEPTIONS=<!@(find <(OZW_INC) -name OZWException.h | wc -l)",
9193
"OPENZWAVE_BITSET=<!@(find <(OZW_INC) -name ValueBitSet.h | wc -l)",
94+
"OPENZWAVE_VALUETYPE_FROM_ENUM=<!@(ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::Value::GetTypeNameFromEnum | wc -l)",
95+
"OPENZWAVE_VALUETYPE_FROM_VALUEID=<!@(ldconfig -p | grep 'libopenzwave.so ' | awk '{print $4}' | xargs nm -g --demangle |grep OpenZWave::ValueID::GetTypeAsString | wc -l)",
9296
],
9397
"link_settings": {
9498
"libraries": ["-lopenzwave"]
@@ -121,7 +125,8 @@
121125
"OPENZWAVE_ETC=<(OZW_HOME)/config",
122126
"OPENZWAVE_SECURITY=1",
123127
"OPENZWAVE_EXCEPTIONS=1",
124-
"OPENZWAVE_BITSET=1"
128+
"OPENZWAVE_BITSET=1",
129+
"OPENZWAVE_VALUETYPE_FROM_VALUEID=1"
125130
],
126131
'msvs_settings': {
127132
'VCCLCompilerTool': {

src/utils.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,16 @@ namespace OZW {
252252
AddStringProp(nodeobj, value_id, buffer.c_str());
253253
AddIntegerProp(nodeobj, node_id, value.GetNodeId());
254254
AddIntegerProp(nodeobj, class_id, value.GetCommandClassId());
255+
#if OPENZWAVE_VALUETYPE_FROM_VALUEID
256+
AddStringProp (nodeobj, type, value.GetTypeAsString());
257+
AddStringProp (nodeobj, genre, value.GetGenreAsString());
258+
#elif OPENZWAVE_VALUETYPE_FROM_ENUM
255259
AddStringProp (nodeobj, type, OpenZWave::Value::GetTypeNameFromEnum(value.GetType()));
256260
AddStringProp (nodeobj, genre, OpenZWave::Value::GetGenreNameFromEnum(value.GetGenre()));
261+
#else
262+
AddIntegerProp(nodeobj, type, value.GetType());
263+
AddIntegerProp(nodeobj, genre, value.GetGenre());
264+
#endif
257265
AddIntegerProp(nodeobj, instance, value.GetInstance());
258266
AddIntegerProp(nodeobj, index, value.GetIndex());
259267
AddStringProp (nodeobj, label, mgr->GetValueLabel(value).c_str());

0 commit comments

Comments
 (0)