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

Method SetLevel

cpp/src/Node.cpp:2351–2367  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Helper method to set a device's basic level -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2349// Helper method to set a device's basic level
2350//-----------------------------------------------------------------------------
2351void Node::SetLevel
2352(
2353 uint8 const _level
2354)
2355{
2356 // Level is 0-99, with 0 = off and 99 = fully on. 255 = turn on at last level.
2357 uint8 adjustedLevel = _level;
2358 if( ( _level > 99 ) && ( _level < 255 ) )
2359 {
2360 adjustedLevel = 99;
2361 }
2362
2363 if( Basic* cc = static_cast<Basic*>( GetCommandClass( Basic::StaticGetCommandClassId() ) ) )
2364 {
2365 cc->Set( adjustedLevel );
2366 }
2367}
2368
2369//-----------------------------------------------------------------------------
2370// <Node::SetNodeOn>

Callers 1

SetNodeLevelMethod · 0.45

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected