MYSENSORS_DEVICE: Avoid warnings in case of external OTA update

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20285 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2019-10-01 12:30:56 +00:00
parent 370609e591
commit 8940a77b83

View File

@ -385,14 +385,13 @@ sub onStreamMessage($$) {
my ($hash, $msg) = @_; my ($hash, $msg) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $type = $msg->{subType}; my $type = $msg->{subType};
#my $typeStr = datastreamTypeToStr($type);
my $blType = AttrVal($name, "OTA_BL_Type", ""); my $blType = AttrVal($name, "OTA_BL_Type", "");
my $blVersion = hex(substr($msg->{payload}, 16, 2)) . "." . hex(substr($msg->{payload}, 18, 2));
my $fwType = hex2Short(substr($msg->{payload}, 0, 4)); my $fwType = hex2Short(substr($msg->{payload}, 0, 4));
TYPE_HANDLER: { TYPE_HANDLER: {
$type == ST_FIRMWARE_CONFIG_REQUEST and do { $type == ST_FIRMWARE_CONFIG_REQUEST and do {
if (length($msg->{payload}) == 20) { if (length($msg->{payload}) == 20) {
my $blVersion = hex(substr($msg->{payload}, 16, 2)) . "." . hex(substr($msg->{payload}, 18, 2));
readingsBeginUpdate($hash); readingsBeginUpdate($hash);
readingsBulkUpdate($hash, 'FW_TYPE', $fwType) if ($blType eq "Optiboot"); readingsBulkUpdate($hash, 'FW_TYPE', $fwType) if ($blType eq "Optiboot");
readingsBulkUpdate($hash, 'FW_VERSION', hex2Short(substr($msg->{payload}, 4, 4))) if ($blType eq "Optiboot"); readingsBulkUpdate($hash, 'FW_VERSION', hex2Short(substr($msg->{payload}, 4, 4))) if ($blType eq "Optiboot");