mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
MAX: split common data into MaxCommon.pm
git-svn-id: https://svn.fhem.de/fhem/trunk@2667 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d350712d63
commit
555d6d0fd5
@ -7,8 +7,8 @@ use strict;
|
||||
use warnings;
|
||||
use MIME::Base64;
|
||||
use POSIX;
|
||||
use MaxCommon;
|
||||
|
||||
require "10_MAX.pm";
|
||||
our %msgCmd2Id;
|
||||
our %device_types;
|
||||
|
||||
|
@ -11,6 +11,7 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
use MIME::Base64;
|
||||
use MaxCommon;
|
||||
|
||||
sub MAX_Define($$);
|
||||
sub MAX_Undef($$);
|
||||
@ -22,19 +23,6 @@ sub MAX_DateTime2Internal($);
|
||||
|
||||
my @ctrl_modes = ( "auto", "manual", "temporary", "boost" );
|
||||
|
||||
use vars qw(%device_types);
|
||||
use vars qw(%msgId2Cmd);
|
||||
use vars qw(%msgCmd2Id);
|
||||
|
||||
%device_types = (
|
||||
0 => "Cube",
|
||||
1 => "HeatingThermostat",
|
||||
2 => "HeatingThermostatPlus",
|
||||
3 => "WallMountedThermostat",
|
||||
4 => "ShutterContact",
|
||||
5 => "PushButton"
|
||||
);
|
||||
|
||||
my %boost_durations = (0 => 0, 1 => 5, 2 => 10, 3 => 15, 4 => 20, 5 => 25, 6 => 30, 7 => 60);
|
||||
my %boost_durationsInv = reverse %boost_durations;
|
||||
|
||||
@ -64,41 +52,6 @@ my %readingDef = ( #min/max/default
|
||||
"valveOffset" => [ \&validValveposition, 00 ],
|
||||
);
|
||||
|
||||
%msgId2Cmd = (
|
||||
"00" => "PairPing",
|
||||
"01" => "PairPong",
|
||||
"02" => "Ack",
|
||||
"03" => "TimeInformation",
|
||||
|
||||
"10" => "ConfigWeekProfile",
|
||||
"11" => "ConfigTemperatures", #like eco/comfort etc
|
||||
"12" => "ConfigValve",
|
||||
|
||||
"20" => "AddLinkPartner",
|
||||
"21" => "RemoveLinkPartner",
|
||||
"22" => "SetGroupId",
|
||||
"23" => "RemoveGroupId",
|
||||
|
||||
"30" => "ShutterContactState",
|
||||
|
||||
"40" => "SetTemperature", #to thermostat
|
||||
"42" => "WallThermostatState", #by WallMountedThermostat
|
||||
#Sending this without payload to thermostat sets desiredTempeerature to the comfort/eco temperature
|
||||
#We don't use it, we just do SetTemperature
|
||||
"43" => "SetComfortTemperature",
|
||||
"44" => "SetEcoTemperature",
|
||||
|
||||
"50" => "PushButtonState",
|
||||
|
||||
"60" => "ThermostatState", #by HeatingThermostat
|
||||
|
||||
"82" => "SetDisplayActualTemperature",
|
||||
|
||||
"F1" => "WakeUp",
|
||||
"F0" => "Reset",
|
||||
);
|
||||
%msgCmd2Id = reverse %msgId2Cmd;
|
||||
|
||||
my %interfaces = (
|
||||
"Cube" => undef,
|
||||
"HeatingThermostat" => "thermostat;battery;temperature",
|
||||
|
@ -5,7 +5,7 @@ package main;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
require "10_MAX.pm";
|
||||
use MaxCommon;
|
||||
|
||||
our %msgId2Cmd;
|
||||
our %msgCmd2Id;
|
||||
|
56
fhem/FHEM/MaxCommon.pm
Normal file
56
fhem/FHEM/MaxCommon.pm
Normal file
@ -0,0 +1,56 @@
|
||||
package MaxCommon;
|
||||
|
||||
#use vars qw(%device_types);
|
||||
#use vars qw(%msgId2Cmd);
|
||||
#use vars qw(%msgCmd2Id);
|
||||
|
||||
require Exporter;
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(%device_types %msgId2Cmd %msgCmd2Id);
|
||||
#@EXPORT_OK = qw($Zeitstempel @Logdaten Besteller_ermitteln);
|
||||
|
||||
%device_types = (
|
||||
0 => "Cube",
|
||||
1 => "HeatingThermostat",
|
||||
2 => "HeatingThermostatPlus",
|
||||
3 => "WallMountedThermostat",
|
||||
4 => "ShutterContact",
|
||||
5 => "PushButton"
|
||||
);
|
||||
|
||||
%msgId2Cmd = (
|
||||
"00" => "PairPing",
|
||||
"01" => "PairPong",
|
||||
"02" => "Ack",
|
||||
"03" => "TimeInformation",
|
||||
|
||||
"10" => "ConfigWeekProfile",
|
||||
"11" => "ConfigTemperatures", #like eco/comfort etc
|
||||
"12" => "ConfigValve",
|
||||
|
||||
"20" => "AddLinkPartner",
|
||||
"21" => "RemoveLinkPartner",
|
||||
"22" => "SetGroupId",
|
||||
"23" => "RemoveGroupId",
|
||||
|
||||
"30" => "ShutterContactState",
|
||||
|
||||
"40" => "SetTemperature", #to thermostat
|
||||
"42" => "WallThermostatState", #by WallMountedThermostat
|
||||
#Sending this without payload to thermostat sets desiredTempeerature to the comfort/eco temperature
|
||||
#We don't use it, we just do SetTemperature
|
||||
"43" => "SetComfortTemperature",
|
||||
"44" => "SetEcoTemperature",
|
||||
|
||||
"50" => "PushButtonState",
|
||||
|
||||
"60" => "ThermostatState", #by HeatingThermostat
|
||||
|
||||
"82" => "SetDisplayActualTemperature",
|
||||
|
||||
"F1" => "WakeUp",
|
||||
"F0" => "Reset",
|
||||
);
|
||||
%msgCmd2Id = reverse %msgId2Cmd;
|
||||
|
||||
1;
|
Loading…
x
Reference in New Issue
Block a user