Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mqtt lwt wildcards #805

Closed
wants to merge 243 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
b7345cf
Merge branch 'master' of https://github.com/hollie/misterhouse
Jun 8, 2013
f286bfa
Merge branch 'master' of https://github.com/hollie/misterhouse
Jun 23, 2013
22d7ded
Merge branch 'master' of https://github.com/hollie/misterhouse
Aug 25, 2013
c876c2a
Merge branch 'master' of https://github.com/hollie/misterhouse
Nov 19, 2013
d02100b
Merge branch 'master' of https://github.com/hollie/misterhouse
Dec 23, 2013
525815a
Merge branch 'master' of https://github.com/hollie/misterhouse
Jan 4, 2014
52e2a57
Merge branch 'master' of https://github.com/hollie/misterhouse
Jan 19, 2014
3a8a28e
Merge branch 'master' of https://github.com/hollie/misterhouse
Jan 20, 2014
a8b7c87
Merge branch 'master' of https://github.com/hollie/misterhouse
Dec 11, 2016
5658106
Merge branch 'master' of https://github.com/hollie/misterhouse
Jan 10, 2017
e8f1e93
Commit unmodifed web/bin/runit.pl
Jan 12, 2017
378a11e
Remove unused internet_weather.pl parameters.
Jan 12, 2017
eca8886
Merge branch 'master' of git://github.com/hollie/misterhouse
Jan 17, 2017
52e69f8
Merge branch 'master' of git://github.com/hollie/misterhouse
Apr 4, 2017
521116a
Merge branch 'master' of git://github.com/hollie/misterhouse
Apr 4, 2017
0cc78b7
Merge branch 'master' of github.com:peloy/misterhouse
Apr 4, 2017
44804cb
Saving files before refreshing line endings
Apr 4, 2017
c1f72c8
Saving files before refreshing line endings
Apr 5, 2017
b6012f5
Merge branch 'master' of github.com:peloy/misterhouse into remove_unu…
Apr 5, 2017
d8ca655
Saving files before refreshing line endings
Apr 5, 2017
c0a5e93
Merge branch 'master' of github.com:peloy/misterhouse into group_trou…
Apr 5, 2017
58726a5
Added debug prints to troubleshoot group creation
Apr 5, 2017
f3b70b2
Merge branch 'master' of github.com:peloy/misterhouse into xpl_testing
Apr 5, 2017
2072c5c
Allow overwrite of _on_set_message data
Apr 5, 2017
4120ec3
Fix Owfs_Item _ToServer calls
Apr 5, 2017
527e4e5
Merge branch 'remove_unused_internet_weather_parms' of github.com:pel…
Apr 5, 2017
b92a588
Merge branch 'fix_owfs_toserver_calls' of github.com:peloy/misterhouse
Apr 5, 2017
244b589
Merge branch 'master' of git://github.com/hollie/misterhouse
Aug 6, 2017
1cad668
Merge branch 'master' of git://github.com/hollie/misterhouse
hplato Aug 25, 2017
f32028a
v1.0.15 - fixed voice commands at reload
hplato Sep 6, 2017
dbcd000
prevent voice commands from rerunning at reload
hplato Sep 6, 2017
0c7cf88
Merge branch 'nanoleaf_aurora'
hplato Sep 6, 2017
53a16cb
Merge pull request #12 from hollie/master
Sep 21, 2017
d9bd75b
Merge pull request #13 from hplato/ia7
Sep 21, 2017
55033d4
Merge pull request #14 from waynieack/HTTP_Updates
Sep 21, 2017
41d1558
Merge pull request #15 from hplato/ia7
Oct 3, 2017
c02c6bd
Merge pull request #16 from hplato/ia7
Oct 7, 2017
dae5985
Merge branch 'master' of git://github.com/hollie/misterhouse
Oct 16, 2017
06d8d0d
Merge pull request #17 from waynieack/HTTP_Updates
Oct 27, 2017
0c55dbe
scalar keys
hplato Oct 31, 2017
a933aa5
Merge branch 'master' of git://github.com/hollie/misterhouse into act…
Nov 2, 2017
e7c33d6
Add support for the AoG Smart Home Provider
Nov 4, 2017
a9f634b
Do not try to get device status before responding
Nov 4, 2017
04c8e05
Unconditionally send "on" state in QUERY response
Nov 4, 2017
1d0fe78
ia7: add live pop-ups of zoneminder events
Nov 5, 2017
8c86c2d
Split get_set_state into get_state and set_state
Nov 16, 2017
221bf25
Change read size from 1500 bytes to 65535
Nov 16, 2017
67eac51
Check for mandatory .ini params. Re-org debug msgs
Nov 19, 2017
a78af3d
update zm.js documentation
Nov 26, 2017
8380611
skip empty group definition in items.mht
Feb 15, 2017
c3d7a8d
raZberry: make razberry read table use 'poll/push' setting
Nov 5, 2017
8d4c1f9
PLCBUS: Make creation of setup voice commands optional
Nov 5, 2017
ebdb97a
Merge pull request #25 from tobser/zoneminder_ia7_popup
hplato Nov 27, 2017
67914b3
Merge pull request #740 from tobser/ignore_empty_group_in_items.mht
hplato Nov 27, 2017
ebe2574
Merge pull request #741 from tobser/raZberry_push_option
hplato Nov 27, 2017
c3ca782
Merge pull request #742 from tobser/optional_plcbus_setup_commands
hplato Nov 27, 2017
7820ac3
v1.1.01 - v2.2.0 firmware and Rhythm detection
hplato Dec 5, 2017
ac9fda4
Add Experimental Support For INSTEON Thermostat
Dec 19, 2017
0e270ce
Add Descriptions For New .mht file AoG Items
Dec 19, 2017
33b40ea
Added patch from Eloy Paris to dynamically find MH install directory/…
Dec 28, 2017
9fba45b
Updates to MySensors.pm to fix issues with sensors which reported num…
Jan 2, 2018
bcf8d98
Updates to MySensors.pm to fix issues with sensors which reported num…
Jan 4, 2018
f2009f4
git commit -m
Jan 9, 2018
3431b84
fix show slider for numeric state values without "%"
Jan 14, 2018
05fc369
Merge pull request #743 from waynieack/mht_editor
hplato Jan 14, 2018
2e1d740
Merge pull request #745 from waynieack/AlexaBridge
hplato Jan 14, 2018
67978ca
Merge pull request #746 from tobser/fix_ia7_sliders
hplato Jan 14, 2018
b23c8da
v1.1.01
hplato Jan 21, 2018
3fe8c35
nanoleaf
hplato Jan 21, 2018
a81682c
json server
hplato Jan 21, 2018
5cd40cd
Updates to MySensors.pm to add time support and custom sensors
Feb 9, 2018
719ecd1
raZberry: fix typo in temperature values (replace second 16 with 26)
Feb 11, 2018
dfa781e
ia7: static page, bind click for button only once
Feb 11, 2018
177f93c
ia7: direct_control for items with more than 2 states
Feb 11, 2018
a6ea2a7
PLCBUS: more commands only visible in setup mode
Feb 12, 2018
be11073
http_server: add support for X-Real-IP header
Feb 12, 2018
108c325
Merge pull request #750 from tobser/http_server_X-Real-IP
hplato Feb 12, 2018
210b517
Merge pull request #749 from tobser/plcbus_updates
hplato Feb 12, 2018
7aa02e3
Merge pull request #747 from jsiddall/MySensors_Updates
hplato Feb 12, 2018
f1ab944
Merge pull request #748 from tobser/ia7_direct_control
hplato Feb 19, 2018
b98dc6e
Cleaned up logging, added reconnect, added support for Homi, fixed is…
Feb 19, 2018
eabaea8
Cleaned some of the documentation
Feb 19, 2018
432a87a
Merge pull request #751 from waynieack/mqtt
hplato Feb 19, 2018
fd028ce
Merge branch 'master' of git://github.com/hollie/misterhouse
hplato Feb 19, 2018
f4c7fdc
ical2vsdb v5 - filter out bad ALARM dates, ability to override all us…
hplato Feb 19, 2018
b08d025
Merge branch 'master' of github.com:hplato/misterhouse
hplato Feb 19, 2018
ba3b6bf
Updated Nanoleaf Aurora
hplato Feb 19, 2018
812a260
Revert voice command test for Insteon.pm
hplato Feb 19, 2018
05d12f0
Merge pull request #752 from hplato/master
hplato Feb 20, 2018
3b03480
ical2vsdb v5.1 - added in option to sort ical prior to MD5 hash to pr…
hplato Feb 20, 2018
48aa6fc
homebridge.pl: Use "http_address" alongside "http_port" to construct …
ebardsley Feb 21, 2018
8f8037c
xml_server.pl: Remove an extra blank line at the beginning of the res…
ebardsley Feb 21, 2018
fc1611c
Merge pull request #753 from hplato/master
hplato Feb 21, 2018
d906bbb
Merge pull request #754 from ebardsley/ebardsley/homebridge
hplato Feb 21, 2018
b5b12c6
Merge pull request #755 from ebardsley/ebardsley/xml_server
hplato Feb 21, 2018
61a5094
merge master
hplato Feb 21, 2018
a5b301f
raZberry v2.2.0 - Update to push system
hplato Feb 23, 2018
8e8d939
raZberry v2.2.1 - thermostat and push updates
hplato Feb 23, 2018
4037718
IA7 v2 - modular script loading, http support for sending compressed …
hplato Mar 2, 2018
af3e43c
razberry v2.2.1
hplato Mar 2, 2018
044f0a0
v2.2.1
hplato Mar 2, 2018
7541dd9
Merge branch 'master' into ia7
hplato Mar 2, 2018
50a0588
Merge pull request #756 from hplato/master
hplato Mar 2, 2018
80058bc
v2.0.150 - manually add in tobi's direct control stuff
hplato Mar 2, 2018
8052775
IA7 v2.0.200 - loader and added back dependancies to index.shtml
hplato Mar 3, 2018
b9c7816
IA7 v2.0.210 - started IA7 native triggers, long press fix for mobile
hplato Mar 5, 2018
aa6270d
IA7 v2.0.300 - updates to triggers, added loading to flot
hplato Mar 7, 2018
7835894
IA7 v2.0.310 - fixed zoneminder config setup
hplato Mar 7, 2018
69adacd
Fix for broken site lookup due to NOAA site changes.
Mar 9, 2018
5d4c5b6
IA7 v2.0.310 - working native triggers, collection update, bugfixes
hplato Mar 9, 2018
b4d4775
IA7 v2.0.350 - cleaned up trigger css
hplato Mar 10, 2018
edd029a
zm.js - fixed so image is always within modal
hplato Mar 10, 2018
ca52b23
Merge pull request #757 from waynieack/WeatherNOAA
marcmerlin Mar 11, 2018
835382b
IA7 v2.0.500 - trigger fixes, reconnections
hplato Mar 15, 2018
48f983f
IA7 v2.0.520 - trigger instructions, json_get security data
hplato Mar 21, 2018
9cf3f1c
IA7 v2.0.600 - security function, read data
hplato Mar 21, 2018
74bf593
IA7 v2.0.600 - editable user management, collections v1.6
hplato Mar 22, 2018
e335057
IA7 v2.0.610 - editable user management, collections v1.6
hplato Mar 22, 2018
d2a27af
IA7 v2.0.620 - security editable checklists
hplato Mar 23, 2018
333da62
IA7 v2.0.670 - working add / delete groups
hplato Mar 23, 2018
6506450
added user-agent-full
hplato Apr 13, 2018
80e5d9b
Merge pull request #18 from hollie/master
Jul 1, 2018
f84ecc2
Merge pull request #19 from hplato/ia7
Jul 1, 2018
6207fc7
v1.3 - better error recovery if bad WU data..
hplato Jul 7, 2018
56e7c6b
fixed up some formatting, prevented side scrolling
hplato Jul 7, 2018
64c00cd
fixed unlink typo
hplato Jul 7, 2018
87ee7f2
IA7 v2.0.680 - fixed up something went wrong opacity
hplato Jul 7, 2018
4a6660d
Merge branch 'master' into nanoleaf_aurora
hplato Jul 8, 2018
18470d0
IA7 v2.0.690 - fixed login issue
hplato Jul 11, 2018
e0a551b
v1.0
hplato Jul 16, 2018
3969e33
v1.0
hplato Jul 16, 2018
022784f
v1.1.03 - fixed a few typos
hplato Jul 17, 2018
7322870
v1.1.03 - fixed a few typos
hplato Jul 17, 2018
760fda5
v1.0.1 - basic and color control
hplato Jul 17, 2018
4223f5c
Merge pull request #758 from hplato/nanoleaf_aurora
hplato Aug 14, 2018
6bbb44e
Merge pull request #759 from hplato/eto
hplato Aug 14, 2018
d6b1599
Merge pull request #760 from hplato/ia7
hplato Aug 14, 2018
c5e5d21
Make the self-test code more explicit so people are aware it is running
hollie Aug 15, 2018
dd48b63
Merge pull request #761 from hollie/more_verbose_test_code
hollie Aug 15, 2018
e9a6724
v1.2 - color, brightness controls
hplato Aug 22, 2018
672f17b
v1.3.1 - minor formatting changes
hplato Aug 22, 2018
3e4f086
Merge remote-tracking branch 'hollie/master'
Aug 22, 2018
9daf8a6
Merge branch 'master' into actions_on_google_smart_home_provider
Aug 22, 2018
5083640
Revert "Fix Owfs_Item _ToServer calls"
Aug 23, 2018
1ae899e
Revert "Remove unused internet_weather.pl parameters."
Aug 23, 2018
e7d3215
Revert "Added debug prints to troubleshoot group creation"
Aug 23, 2018
1d185cf
Revert "Allow overwrite of _on_set_message data"
Aug 23, 2018
f4600c6
Revert local change unrelated to work performed on this branch
Aug 23, 2018
fe0d9fd
Revert local change unrelated to work on this branch
Aug 23, 2018
d9e33e2
v1.2.1 - cleaned up some logging
hplato Aug 23, 2018
8f33804
v3.0.0 - motion objects and non-pausing process_item model
hplato Aug 23, 2018
cde04ab
v2.0.750 - color slider control
hplato Aug 23, 2018
5df404d
fixed class definitions
hplato Aug 24, 2018
bc45b3f
v3.0.1 - fixed push timers
hplato Aug 24, 2018
59f910a
v3.0.2 - more process item testing
hplato Aug 24, 2018
79a797a
v3.0.3 - command queue works
hplato Aug 24, 2018
b05fb9f
v3.0.4 - fixed command queing
hplato Aug 25, 2018
df6a7cb
v1.2.3 - better command queue processing
hplato Aug 25, 2018
ae5150f
process_item helper for issuing tcp commands
hplato Aug 25, 2018
3c3058f
fixed display when either grass or shrubs are being watered
hplato Aug 25, 2018
46acad7
static pages need an update to work with v2.0.750
hplato Aug 25, 2018
4357413
v2.0.751 - fixed RRD display
hplato Aug 25, 2018
0000c11
Merge pull request #764 from hplato/yeelight
hplato Aug 25, 2018
5964947
Merge pull request #765 from hplato/eto
hplato Aug 25, 2018
b3693b0
Merge pull request #762 from peloy/actions_on_google_smart_home_provider
hplato Aug 25, 2018
7b8e5f2
Merge pull request #766 from hplato/ia7
hplato Aug 27, 2018
be0cd3b
Merge pull request #763 from hplato/razberry
hplato Aug 27, 2018
dff63bd
v2.0.800 - fixed voice command color change
hplato Sep 2, 2018
941c9f0
remove some debug statements
hplato Sep 2, 2018
58c095d
fixed queue printing
hplato Sep 2, 2018
3182e5a
v1.2.6 - command queue, and off to brightness fixes
hplato Sep 2, 2018
7ece140
added in some more runtime details
hplato Sep 3, 2018
e419cad
fixed typo
hplato Sep 3, 2018
35f90d0
ia7 speaker icon
hplato Sep 3, 2018
361e077
Multioltage Device Registration fix
jonwhitear Sep 4, 2018
318989c
Merge pull request #768 from jonwhitear/raZberry_multivoltage
hplato Sep 4, 2018
826441e
Merge pull request #1 from hollie/master
jonwhitear Sep 5, 2018
8ea9c6f
CBus->CGate Socket checks
jonwhitear Sep 7, 2018
2a65c0e
removed duplicate message
hplato Sep 9, 2018
6873d21
Update Timer State for web display
hplato Sep 28, 2018
334d69f
ia7 v2.0.810 - fixed transition from undefined state
hplato Sep 28, 2018
e433f06
Merge pull request #769 from jonwhitear/CBus_conn_checks
hplato Sep 28, 2018
f168562
only add hooks if timer is active and remove hook for inactive timer
hplato Oct 3, 2018
7bfed78
Merge pull request #770 from hplato/ia7
hplato Oct 4, 2018
3aa57cb
Merge pull request #771 from hplato/razberry
hplato Oct 4, 2018
ad7a6c9
Merge pull request #772 from hplato/timer_states
hplato Oct 4, 2018
7f4e0a1
v1.2.8
hplato Oct 7, 2018
2d05b20
v1.2.9
hplato Oct 7, 2018
20cc136
v1.3.0 - no id needed on object
hplato Oct 8, 2018
963cc22
v2.0.820 - fixed color sliders on all objects
hplato Nov 20, 2018
818d9a8
Fix unescaped braces in issue #744
gac410 Apr 14, 2019
1bb9387
fix http redirect with nginx proxy
May 13, 2019
1000256
prevent warning with alexa/echo
May 13, 2019
98ea66f
v2.0.1 - dark sky as the data provider
hplato May 22, 2019
ae99310
Merge pull request #779 from hplato/ia7
hplato May 22, 2019
d9e4eeb
Merge pull request #778 from hplato/eto
hplato May 22, 2019
8e24b93
Merge pull request #775 from gac410/master
hplato May 22, 2019
e78e59b
Merge pull request #776 from tobser/nginx_http_redirect
hplato May 22, 2019
d188b2e
Merge pull request #777 from tobser/prevent_warning_with_echo
hplato May 22, 2019
30a101c
Move led_level from Insteon::MicroSwitch to Insteon::BaseLight, as it…
May 23, 2019
e87cd58
Add beep() method to Insteon::DimmableLight
May 23, 2019
42e2ffc
fix regulare expression to check content type
May 28, 2019
2460bb1
Create fallback directory, and populate it with MH-supplied versions …
Jun 5, 2019
3a9dbeb
Add lib/fallback to stand-alone programs
Jun 5, 2019
60c6ee8
Move lib/fallback/Geo back to lib/site/Geo, as these are modified ver…
Jun 11, 2019
f8fc131
Various fixes to sub states. Fixes for the discovery on newer Echo ve…
Nov 5, 2019
754ddc7
Merge pull request #20 from waynieack/AlexaBridge
Nov 13, 2019
7e7b7e8
Long discovery string is only returned with gzip compression now. The…
Nov 15, 2019
fae76f6
Fixed matching alpha in newer AD2 firmware, older firmware was numeri…
Dec 2, 2019
2fea099
Merge pull request #790 from waynieack/AD2
hplato Dec 7, 2019
23b7039
Merge pull request #781 from mhgithub20/beep
hplato Dec 7, 2019
dbc269c
Merge pull request #782 from mhgithub20/led_level
hplato Dec 7, 2019
e6d76c8
Merge pull request #783 from tobser/prevent_warning_with_echo
hplato Dec 7, 2019
2c608db
Merge pull request #791 from hplato/yeelight
hplato Dec 7, 2019
bffe5cd
Merge pull request #786 from mhgithub20/fallback-modules
marcmerlin Mar 23, 2020
0628f37
Merge pull request #1 from hollie/master
marcmerlin May 3, 2020
a635e12
Fixed debugging for CMxx, now process data the first time it's sent.
marcmerlin May 3, 2020
ec395d3
Merge pull request #793 from marcmerlin/master
marcmerlin May 3, 2020
f334b1c
Merge pull request #21 from hollie/master
Jul 5, 2020
3c1718d
Add BondHome.pm
Jul 5, 2020
604628e
BondHome version 1
Jul 19, 2020
402ba54
Added BondHome_Manual object to read_table_A.pl and updated docs
Jul 19, 2020
d2d864f
removed collections.json from the push
Jul 20, 2020
52399bc
removed collections.json from the push
Jul 20, 2020
56b10ea
removed collections.json from the push
Jul 20, 2020
8938a87
Add support for chunked POST
rudybrian Jul 28, 2020
403f6db
Suppress warning with chunked JSON
rudybrian Jul 28, 2020
950eab0
add debug else to xAP message
pmatis Dec 6, 2020
e15d74d
Update Venstar_Colortouch.pm for new perl version. Add parameter to g…
pmatis Dec 6, 2020
b1b0d24
bin: correct @INC in stand-alone Perl programs so lib/fallback is last
Dec 10, 2020
3571f14
Merge pull request #795 from waynieack/BondHome
hplato Dec 11, 2020
31a0dfa
Merge pull request #796 from rudybrian/add_chunked_http_post_support
hplato Dec 11, 2020
0c46703
Merge pull request #797 from pmatis/venstar_new_perl
hplato Dec 11, 2020
71f6fd0
Merge pull request #798 from bpmartin20/bin-fallback
hplato Dec 11, 2020
7bc0839
Add Tasmota over HTTP support
jsiddall Dec 16, 2020
1726667
Update README.md
hollie Dec 16, 2020
0c64254
Update .travis.yml
hollie Dec 16, 2020
44a6bea
Update .travis.yml
hollie Dec 16, 2020
ba3deff
Merge pull request #801 from pmatis/xap_debug
hollie Dec 16, 2020
532e234
Merge pull request #803 from jsiddall/Tasmota_HTTP_Item
hollie Dec 16, 2020
f288a30
MQTT read_table_A.pl support written by Giles Godart-Brown
jsiddall Dec 16, 2020
e78531f
Merge pull request #804 from jsiddall/MQTT_table_support
hollie Dec 17, 2020
3480655
adding wildcards and LWT to mqtt.pm
ggodart Dec 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ os:
dist: trusty

perl:
- "5.30"
- "5.24"
- "5.18"
- "5.16"
- "5.08"

install: true

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MisterHouse
===========

[![Build Status](https://travis-ci.org/hollie/misterhouse.svg?branch=master)](https://travis-ci.org/hollie/misterhouse)
[![Build Status](https://travis-ci.com/hollie/misterhouse.svg?branch=master)](https://travis-ci.com/hollie/misterhouse)

Perl open source home automation program. It's fun, it's free, and it's entirely geeky.

Expand Down
4 changes: 3 additions & 1 deletion bin/alpha_page
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";

}

use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_earthquakes
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ eof
}

BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy
require 'handy_utilities.pl'; # For read_mh_opts funcion

Expand Down
3 changes: 2 additions & 1 deletion bin/get_email
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.+)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
$Pgm_Root = "$Pgm_Path/..";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # Use BEGIN eval to keep perl2exe happy
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

use Getopt::Long;
Expand Down
125 changes: 125 additions & 0 deletions bin/get_tcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#!/usr/bin/env perl
# -*- Perl -*-

use strict;
use IO::Socket;

# Similar to get_url, open a socket and then get the data. Useful to spawn off as a process_item to avoid pauses

my ( $Pgm_Path, $Pgm_Name );

BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my ( %config_parms, %parms );

use Getopt::Long;

if (
!&GetOptions( \%parms, 'h', 'help', 'quiet', 'timeout=s', 'rn')
or !@ARGV
or $parms{h}
or $parms{help}
)
{

print <<eof;

$Pgm_Name similar to get_url, opens a socket to host and echos response to STDOUT or a local file.

Usage:

$Pgm_Name [-quiet] host:post data [local_file]

-quiet: no output on stdout
-timeout: in seconds. Defaults is 3 seconds
-rn: send \r\n to the data

If local_file is specified, data is stored there.
If local_file = /dev/null, data is not returned.
Otherwise, data is echoed to STDOUT.


eof
exit;
}

my $timeout = 3;
$timeout = $parms{timeout} if ($parms{timeout});

my $location = shift;

my ($host, $port) = $location =~ /^(\S+)(:\d+)/;

$port =~ s/://g;

my $data = shift;

$data .= "\r\n" if ($parms{rn});

unless ($host and $port and $data) {
print "get_tcp_error: missing parameters: ";
print "host " unless ($host);
print "port " unless ($port);
print "data " unless ($data);
print "\n";
exit;
}


# Get parms from mh.ini
require 'handy_utilities.pl';
&main::read_mh_opts( \%config_parms, $Pgm_Path );

my $file = shift;
my $response = "";
my $error = 1;

my $tcp = new IO::Socket::INET(
PeerHost => $host,
PeerPort => $port,
Timeout => $timeout,
Proto => "tcp") or $response = "get_tcp_error: opening socket: $!.\n";
#print "error $host:$port\n" if ($tcp->connected());

unless ($response) {
$error = 0;
print "Sending data to $location " unless $parms{quiet};
print "into $file" unless ($parms{quiet} or !$file);
print "..." unless $parms{quiet};

$tcp->send($data) or $response = "get_tcp_error: Couldn't send: $!";

unless ($response) {
$tcp->recv($response, 1024);
print " data retrieved\n" unless $parms{quiet};
} else {
$error = 1;
}
}
if ($file) {
# print $data;
unless ( $file eq '/dev/null' ) {
if ($response) {
open( OUT, ">$file" )
or die "get_tcp_error: could not open file '$file' for output: $!\n";
binmode OUT;
print OUT $response;
close OUT;
}
else {
print " empty data response\n";
}
}
} else {
print $response;
}


$tcp->close() unless ($error);


3 changes: 2 additions & 1 deletion bin/get_tv_grid
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

require "RedirAgent.pm";
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_grid_ge
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}
my %parms;
use Getopt::Long;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_grid_xmltv
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ BEGIN {
($Version) = q$Revision$ =~ /: (\S+)/; # Note: revision number is auto-updated by cvs
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # So perl2exe works
eval "push \@INC, '$Pgm_Path/../lib/fallback';"; # So perl2exe works
}

use XMLTV::Version '$Id$ ';
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_info
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ BEGIN {

( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
3 changes: 2 additions & 1 deletion bin/get_tv_info_ge
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ BEGIN {

( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my %parms;
Expand Down
10 changes: 7 additions & 3 deletions bin/get_url
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ my ( $Pgm_Path, $Pgm_Name );
BEGIN {
( $Pgm_Path, $Pgm_Name ) = $0 =~ /(.*)[\\\/](.*)\.?/;
($Pgm_Name) = $0 =~ /([^.]+)/, $Pgm_Path = '.' unless $Pgm_Name;
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # So perl2exe works
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
}

my ( %config_parms, %parms );
Expand All @@ -19,7 +20,7 @@ use Getopt::Long;
#print "get_url: @ARGV\n";
if (
!&GetOptions( \%parms, 'h', 'help', 'quiet', 'cookies=s', 'cookie_file_in=s', 'cookie_file_out=s', 'post=s', 'header=s', 'userid=s', 'password=s', 'ua',
'put=s', 'json', 'response_code' )
'put=s', 'timeout=s', 'json', 'response_code' )
or !@ARGV
or $parms{h}
or $parms{help}
Expand All @@ -32,7 +33,7 @@ if (

Usage:

$Pgm_Name [-quiet] [-cookies 'cookiestr'] [-post 'poststr'] [-header header_file] url [local_file]
$Pgm_Name [-quiet] [-cookies 'cookiestr'] [-post 'poststr'] [-header header_file] [-timeout X] url [local_file]

-quiet: no output on stdout

Expand All @@ -59,6 +60,7 @@ Usage:

-response_code: STDOUT only: Prepend output with RESPONSECODE: <response code>\n

-timeout: XX : number of seconds to wait for command to complete

If local_file is specified, data is stored there.
If local_file = /dev/null, data is not returned.
Expand Down Expand Up @@ -113,6 +115,8 @@ sub use_ua {
if $config_parms{proxy};

$ua->timeout(30); # Time out after 30 seconds
$ua->timeout($parms{timeout} ) if $parms{timeout};

$ua->env_proxy();
$ua->agent( $config_parms{get_url_ua} ) if $config_parms{get_url_ua};

Expand Down
4 changes: 2 additions & 2 deletions bin/get_weather
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ $opt_v++ if $parms{v}; # Geo::Weather looks at this
my $caller = caller;
my $return_flag = ( $caller and $caller ne 'main' ) ? 1 : 0;

#use my_lib "$Pgm_Path/../lib/site"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy

require 'handy_utilities.pl'; # For read_mh_opts funcion
Expand Down
4 changes: 2 additions & 2 deletions bin/get_weather_ca
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ use vars qw(%Weather @Weather_Forecast);
my $caller = caller;
my $return_flag = ( $caller and $caller ne 'main' ) ? 1 : 0;

#use my_lib "$Pgm_Path/../lib/site"; # See note in lib/mh_perl2exe.pl for lib -> my_lib explaination
BEGIN {
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'";
eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site';"; # Use BEGIN eval to keep perl2exe happy
eval "push \@INC, '$Pgm_Path/../lib/fallback';";
} # Use BEGIN eval to keep perl2exe happy

require 'handy_utilities.pl'; # For read_mh_opts funcion
Expand Down
Loading