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

Method CreateVars

cpp/src/command_classes/SwitchMultilevel.cpp:652–689  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

650// Create the values managed by this command class
651//-----------------------------------------------------------------------------
652void SwitchMultilevel::CreateVars
653(
654 uint8 const _instance
655)
656{
657 if( Node* node = GetNodeUnsafe() )
658 {
659 switch( GetVersion() )
660 {
661 case 4:
662 {
663 node->CreateValueByte( ValueID::ValueGenre_System, GetCommandClassId(), _instance, SwitchMultilevelIndex_TargetValue, "Target Value", "", true, false, 0, 0 );
664 // Fall through to version 3
665 }
666 case 3:
667 {
668 node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Step, "Step Size", "", false, false, 0, 0 );
669 node->CreateValueButton( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Inc, "Inc", 0 );
670 node->CreateValueButton( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Dec, "Dec", 0 );
671 // Fall through to version 2
672 }
673 case 2:
674 {
675 node->CreateValueByte( ValueID::ValueGenre_System, GetCommandClassId(), _instance, SwitchMultilevelIndex_Duration, "Dimming Duration", "", false, false, 0xff, 0 );
676 // Fall through to version 1
677 }
678 case 1:
679 {
680 node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Level, "Level", "", false, false, 0, 0 );
681 node->CreateValueButton( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Bright, "Bright", 0 );
682 node->CreateValueButton( ValueID::ValueGenre_User, GetCommandClassId(), _instance, SwitchMultilevelIndex_Dim, "Dim", 0 );
683 node->CreateValueBool( ValueID::ValueGenre_System, GetCommandClassId(), _instance, SwitchMultilevelIndex_IgnoreStartLevel, "Ignore Start Level", "", false, false, true, 0 );
684 node->CreateValueByte( ValueID::ValueGenre_System, GetCommandClassId(), _instance, SwitchMultilevelIndex_StartLevel, "Start Level", "", false, false, 0, 0 );
685 break;
686 }
687 }
688 }
689}
690
691
692

Callers

nothing calls this directly

Calls 5

GetVersionFunction · 0.85
GetCommandClassIdFunction · 0.85
CreateValueByteMethod · 0.80
CreateValueButtonMethod · 0.80
CreateValueBoolMethod · 0.80

Tested by

no test coverage detected