Skip to content

Set Values are not getting refreshed after commit 0c82d4b0831b197c88c56e75270c423c9eee24cb #2637

@aerofeev2k

Description

@aerofeev2k

Hi, @markruys

What is the purpose of this change in Value.cpp?

if (!IsWriteOnly())
{
-       // queue a "RequestValue" message to update the value
-       if (m_refreshAfterSet) {
-               cc->RequestValue( 0, m_id.GetIndex(), m_id.GetInstance(), Driver::MsgQueue_Send );
+       if (m_refreshAfterSet)
+       {
+           if (!node->GetCommandClass(Internal::CC::Supervision::StaticGetCommandClassId()))
+           {
+               // queue a "RequestValue" message to update the value
+               cc->RequestValue( 0, m_id.GetIndex(), m_id.GetInstance(), Driver::MsgQueue_Send );
+           }
        }
}

It broke setting LEDs in Homeseer HS-WD200+. Now whenever a LED is turned ON or OFF, the command is delivered to the Homeseer, but the value in the OZW memory is not updated. And since Domoticz checks current value before setting a new one, this causes problems for sequences like this:

  1. Turn LED1 to Red (works if current value is Off)
  2. Turn LED1 to Off (doesn't do anything because the value is still Off in OZW memory).

I checked what GetCommandClass() returns in my case, and it's not NULL, so RequestValue() is not getting called.

I wonder if this entire "skip refresh" logic should be accounted for here:

bool ValueInt::Set(int32 const _value)
{
// create a temporary copy of this value to be submitted to the Set() call and set its value to the function param
ValueInt* tempValue = new ValueInt(*this);
tempValue->m_value = _value;
// Set the value in the device.
bool ret = ((Value*) tempValue)->Set();
// clean up the temporary value
delete tempValue;
return ret;
}

where the code is just creating a temporary value and is sending it to the device, apparently expecting that a refresh will happen in the end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions