add lona readings

This commit is contained in:
Sebastian
2022-05-27 11:44:59 +02:00
parent 234607cb8d
commit 40074a3db6
3 changed files with 21 additions and 9 deletions

View File

@ -776,13 +776,25 @@ sub WriteReadings {
if ( ref( $propertie->{value} ) eq "HASH" ) {
while ( my ( $r, $v ) = each %{ $propertie->{value} } ) {
readingsBulkUpdate(
$hash,
$decode_json->{abilities}[$abilities]{name} . '-'
^ if ( ref( $v ) ne "HASH" ) {
readingsBulkUpdate(
$hash,
$decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name} . '_'
. $r,
RigReadingsValue( $hash, $v )
);
} else {
while ( my ( $i_r, $i_v ) = each %{ $v } ) {
readingsBulkUpdate(
$hash,
$decode_json->{abilities}[$abilities]{name} . '-'
. $propertie->{name} . '_'
. $r,
RigReadingsValue( $hash, $v )
);
. $r . '_' . $i_r,
RigReadingsValue( $hash, $i_v )
);
}
}
}
}
}