@@ -128,14 +128,25 @@ void setValObj(Local<Object> &valobj, OpenZWave::ValueID &value)
128128 }
129129 case OpenZWave::ValueID::ValueType_List:
130130 {
131- ::std::string val;
132- ::std::vector<::std::string> items;
131+ int32 val;
132+ ::std::vector <::std::string > items;
133+ ::std::vector <int32> itemsvalues;
134+ v8::Local<v8::Object> values = Nan::New<v8::Object>();
135+
133136 // populate array of all available items in the list
134- OZWManager (GetValueListItems, value, &items);
135- AddArrayOfStringProp (valobj, values, items);
137+ OZWManager ( GetValueListItems, value, &items);
138+ OZWManager ( GetValueListValues, value, &itemsvalues);
139+
140+ // popolate the object value: item
141+ for (int i = 0 ; (unsigned )i < items.size (); i++) {
142+ Nan::Set (values, Nan::New<v8::String>(::std::to_string (itemsvalues[i])).ToLocalChecked (), Nan::New<v8::String>(items[i].c_str ()).ToLocalChecked ());
143+ }
144+
145+ Nan::Set (valobj, Nan::New<v8::String>(" values" ).ToLocalChecked (), values);
136146 // populated selected element
137- OZWManager (GetValueListSelection, value, &val);
138- AddStringProp (valobj, value, val.c_str ()) break ;
147+ OZWManager ( GetValueListSelection, value, &val);
148+ AddIntegerProp (valobj, value, val);
149+ break ;
139150 }
140151 case OpenZWave::ValueID::ValueType_Short:
141152 {
0 commit comments