MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / CreateVars

Method CreateVars

cpp/src/command_classes/ClimateControlSchedule.cpp:379–406  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Create the values managed by this command class -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

377// Create the values managed by this command class
378//-----------------------------------------------------------------------------
379void ClimateControlSchedule::CreateVars
380(
381 uint8 const _instance
382)
383{
384 if( Node* node = GetNodeUnsafe() )
385 {
386 // Add a ValueSchedule for each day of the week.
387 for( uint8 i=0; i<7; ++i )
388 {
389 node->CreateValueSchedule( ValueID::ValueGenre_User, GetCommandClassId(), _instance, i+1, c_dayNames[i+1], "", false, false, 0 );
390 }
391
392 // Add values for the override state and setback
393 vector<ValueList::Item> items;
394
395 ValueList::Item item;
396 for( uint8 i=0; i<3; ++i )
397 {
398 item.m_label = c_overrideStateNames[i];
399 item.m_value = i;
400 items.push_back( item );
401 }
402
403 node->CreateValueList( ValueID::ValueGenre_User, GetCommandClassId(), _instance, ClimateControlScheduleIndex_OverrideState, "Override State", "", false, false, 1, items, 0, 0 );
404 node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, ClimateControlScheduleIndex_OverrideSetback, "Override Setback", "", false, false, 0, 0 );
405 }
406}
407

Callers

nothing calls this directly

Calls 4

GetCommandClassIdFunction · 0.85
CreateValueScheduleMethod · 0.80
CreateValueListMethod · 0.80
CreateValueByteMethod · 0.80

Tested by

no test coverage detected