2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-23 08:36:24 +00:00

MYSENSORS_DEVICE: Avoid warnings in case of external OTA update

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

View File

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