@@ -535,10 +535,12 @@ void COpenWebNetTCP::UpdateDeviceValue(vector<bt_openwebnet>::iterator iter)
535
535
string who = iter->Extract_who ();
536
536
string where = iter->Extract_where ();
537
537
string what = iter->Extract_what ();
538
+ std::vector<std::string> whatParam = iter->Extract_whatParameters ();
538
539
string dimension = iter->Extract_dimension ();
539
540
string value = iter->Extract_value (0 );
540
541
string sInterface = iter->Extract_interface ();
541
542
string devname;
543
+ int app_value;
542
544
543
545
switch (atoi (who.c_str ())) {
544
546
case WHO_LIGHTING:
@@ -550,24 +552,20 @@ void COpenWebNetTCP::UpdateDeviceValue(vector<bt_openwebnet>::iterator iter)
550
552
devname = OPENWEBNET_LIGHT;
551
553
devname += " " + where; // 1
552
554
553
- if (atoi (what.c_str ()) == 1000 ) // What = 1000 (Command translation)
554
- {
555
- if (what[4 ] == ' #' )
556
- what = what.substr (5 );
557
- else
558
- _log.Log (LOG_ERROR, " COpenWebNetTCP: Who=%s what=%s" , who.c_str (), what.c_str ());
559
- }
555
+ app_value = atoi (what.c_str ());
556
+ if (app_value == 1000 ) // What = 1000 (Command translation)
557
+ app_value = atoi (whatParam[0 ].c_str ());
560
558
561
559
// pTypeGeneralSwitch, sSwitchLightT1
562
- UpdateSwitch (WHO_LIGHTING, atoi (where.c_str ()), atoi (what. c_str ()) , atoi (sInterface .c_str ()), 100 , devname.c_str (), sSwitchLightT1 );
560
+ UpdateSwitch (WHO_LIGHTING, atoi (where.c_str ()), app_value , atoi (sInterface .c_str ()), 255 , devname.c_str (), sSwitchLightT1 );
563
561
break ;
564
562
case WHO_AUTOMATION:
565
563
if (!iter->IsNormalFrame ())
566
564
{
567
565
_log.Log (LOG_ERROR, " COpenWebNetTCP: Who=%s frame error!" , who.c_str ());
568
566
return ;
569
567
}
570
- int app_value;
568
+
571
569
switch (atoi (what.c_str ()))
572
570
{
573
571
case AUTOMATION_WHAT_STOP: // 0
@@ -580,12 +578,13 @@ void COpenWebNetTCP::UpdateDeviceValue(vector<bt_openwebnet>::iterator iter)
580
578
app_value = gswitch_sOn;
581
579
break ;
582
580
default :
581
+ _log.Log (LOG_ERROR, " COpenWebNetTCP: Who=%s, What=%s invalid!" , who.c_str (), what.c_str ());
583
582
return ;
584
583
}
585
584
devname = OPENWEBNET_AUTOMATION;
586
585
devname += " " + where;
587
586
// pTypeGeneralSwitch, sSwitchBlindsT1
588
- UpdateBlinds (WHO_AUTOMATION, atoi (where.c_str ()), app_value, atoi (sInterface .c_str ()), 100 , devname.c_str ()); // 2
587
+ UpdateBlinds (WHO_AUTOMATION, atoi (where.c_str ()), app_value, atoi (sInterface .c_str ()), 255 , devname.c_str ()); // 2
589
588
break ;
590
589
case WHO_TEMPERATURE_CONTROL:
591
590
if (!iter->IsMeasureFrame ())
@@ -597,7 +596,7 @@ void COpenWebNetTCP::UpdateDeviceValue(vector<bt_openwebnet>::iterator iter)
597
596
{
598
597
devname = OPENWEBNET_TEMPERATURE;
599
598
devname += " " + where;
600
- UpdateTemp (WHO_TEMPERATURE_CONTROL, atoi (where.c_str ()), static_cast <float >(atof (value.c_str ()) / 10 .), 100 , devname.c_str ());
599
+ UpdateTemp (WHO_TEMPERATURE_CONTROL, atoi (where.c_str ()), static_cast <float >(atof (value.c_str ()) / 10 .), 255 , devname.c_str ());
601
600
}
602
601
603
602
else
0 commit comments