From 566a0a08a0cbe1d38c3dee9f13e726fa5c05dbec Mon Sep 17 00:00:00 2001
From: vuffiraa <>
Date: Sun, 8 Mar 2020 09:22:57 +0000
Subject: [PATCH] 70_BRAVIA.pm: add requestReboot
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21376 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
CHANGED | 1 +
FHEM/70_BRAVIA.pm | 22 +++++++++++++++++++---
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/CHANGED b/CHANGED
index 876026e64..bb62b13b2 100644
--- a/CHANGED
+++ b/CHANGED
@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - feature: 70_BRAVIA: add requestReboot (thx schnakker)
- change: 57_SSCal: commandref reviewed
- feature: 98_RandomTimer: Add offState attribute to e.g. evaluate state
reading instead of STATE; NOTE: this will be
diff --git a/FHEM/70_BRAVIA.pm b/FHEM/70_BRAVIA.pm
index 60e54fd29..a91ef7de5 100644
--- a/FHEM/70_BRAVIA.pm
+++ b/FHEM/70_BRAVIA.pm
@@ -24,6 +24,10 @@
# along with fhem. If not, see .
#
##############################################################################
+#
+# 05.03.2020 Sandro Gertz: add "requestReboot"
+#
+##############################################################################
package main;
@@ -204,7 +208,6 @@ sub Get($@) {
return "argument is missing" if ( int(@a) < 2 );
$what = $a[1];
-
if ( $what =~ /^(power|presence|input|channel|volume|mute)$/ ) {
my $value = ReadingsVal($name, $what, "");
if ($value ne "") {
@@ -306,6 +309,7 @@ sub Set($@) {
$usage .= " channel:$channels" if ( $channels ne "" );
$usage .= " openUrl application:" . $apps if ( $apps ne "" );
$usage .= " text" if (ReadingsVal($name, "requestFormat", "") eq "json");
+ $usage .= " requestReboot:noArg " if (ReadingsVal($name, "requestFormat", "") eq "json");
my $cmd = '';
my $result;
@@ -745,7 +749,13 @@ sub Set($@) {
readingsSingleUpdate( $hash, "upnp", $a[2], 1 )
if ( ReadingsVal($name, "upnp", "") ne $a[2] );
}
-
+
+ # reboot
+ elsif ($a[1] eq "requestReboot") {
+ Log3($name, 2, "BRAVIA set $name " . $a[1]);
+ SendCommand( $hash, "requestReboot" );
+ }
+
# text
elsif ( $a[1] eq "text" ) {
return "No 2nd argument given" if ( !defined( $a[2] ) );
@@ -2256,6 +2266,9 @@ sub GetNormalizedName($) {
requestFormat
"xml" for xml based communication (models from 2011 and 2012)
"json" for communication with models from 2013 and newer
+ requestReboot
+ Reboots the TV immediately.
+ This Feature is available on models from 2013 and newer.
remoteControl
Sends command directly to TV.
statusRequest
@@ -2337,7 +2350,7 @@ sub GetNormalizedName($) {
- application
Liste der Anwendungen.
- Anwenungen sind ab Modelljahr 2013 verfügbar.
+ Anwendungen sind ab Modelljahr 2013 verfügbar.
channel
Liste aller bekannten Kanäle. Das Modul merkt sich alle aufgerufenen Kanäle.
Ab Modelljahr 2013 werden die Kanäle automatisch geladen
@@ -2375,6 +2388,9 @@ sub GetNormalizedName($) {
requestFormat
"xml" für xml-basierte Kommunikation 2011er/2012er Geräte
"json" für die Kommunikation seit der 2013er Generation
+ requestReboot
+ Startet den TV direkt neu.
+ Diese Funktion ist ab Modelljahr 2013 verfügbar.
remoteControl
Direktes Senden von Kommandos an den TV.
statusRequest