----------------------------------------------------------------------------- Set the device's scale, or reset its accumulated values. -----------------------------------------------------------------------------
| 521 | // Set the device's scale, or reset its accumulated values. |
| 522 | //----------------------------------------------------------------------------- |
| 523 | bool Meter::SetValue |
| 524 | ( |
| 525 | Value const& _value |
| 526 | ) |
| 527 | { |
| 528 | if( MeterIndex_Reset == _value.GetID().GetIndex() ) |
| 529 | { |
| 530 | ValueButton const* button = static_cast<ValueButton const*>(&_value); |
| 531 | if( button->IsPressed() ) |
| 532 | { |
| 533 | Msg* msg = new Msg( "MeterCmd_Reset", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true ); |
| 534 | msg->SetInstance( this, _value.GetID().GetInstance() ); |
| 535 | msg->Append( GetNodeId() ); |
| 536 | msg->Append( 2 ); |
| 537 | msg->Append( GetCommandClassId() ); |
| 538 | msg->Append( MeterCmd_Reset ); |
| 539 | msg->Append( GetDriver()->GetTransmitOptions() ); |
| 540 | GetDriver()->SendMsg( msg, Driver::MsgQueue_Send ); |
| 541 | return true; |
| 542 | } |
| 543 | } |
| 544 | |
| 545 | return false; |
| 546 | } |
| 547 | |
| 548 | //----------------------------------------------------------------------------- |
| 549 | // <Meter::CreateVars> |
nothing calls this directly
no test coverage detected