From 080ca9b6521496c1a6b595f38dcb4bc6984e66cc Mon Sep 17 00:00:00 2001 From: loredo Date: Sun, 3 Mar 2019 14:37:59 +0000 Subject: [PATCH] 70_Pushover: add html handling for glances git-svn-id: https://svn.fhem.de/fhem/trunk@18779 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/70_Pushover.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/70_Pushover.pm b/fhem/FHEM/70_Pushover.pm index 6c3a612ee..91e7be61f 100644 --- a/fhem/FHEM/70_Pushover.pm +++ b/fhem/FHEM/70_Pushover.pm @@ -1140,6 +1140,20 @@ sub Pushover_SetMessage2 ($$$$) { $values{text} = join ' ', @$a; } + if ( $values{text} =~ /^\s*html:\s*(.*)$/i ) { + Log3 $name, 4, "Pushover $name: Interpreting glance text as HTML"; + $values{html} = 1; + $values{text} = $1; + } + if ( $values{text} =~ + m/\<(\/|)[biu]\>|\<(\/|)font(.+)\>|\<(\/|)a(.*)\>|\/i ) + { + $values{html} = 1; + + # replace \n by
but ignore \\n + $values{text} =~ s/(?/g; + } + $values{subtext} = ( defined( $h->{subtext} ) ? $h->{subtext} : undef ); $values{count} = ( defined( $h->{count} ) ? $h->{count} : undef ); @@ -1579,7 +1593,7 @@ sub Pushover_HttpUri ($$;$) { The following options may be used to adjust message content and delivery behavior:

title    - type: text(100 characters) - A description of the data being shown, such as "Widgets Sold".
- text     - type: text(100 characters) - The main line of data, used on most screens. Using this option takes precedence; non-option text content will be discarded.
+ text     - type: text(100 characters) - The main line of data, used on most screens. Using this option takes precedence; non-option text content will be discarded. If you want your text to be interpreted as HTML by the Pushover client app, add the prefix 'html:' before the actual text (unless you already use HTML tags in it where it is automatically detected).
subtext  - type: text(100 characters) - A second line of data.
count    - type: integer(may be negative) - Shown on smaller screens; useful for simple counts.
percent  - type: integer(0-100) - Shown on some screens as a progress bar/circle.