--- /dev/null
+--- a/www/ozwcp/cp.js 2017-07-30 05:19:41.000000000 -0500
++++ b/www/ozwcp/cp.js 2018-02-22 17:14:52.185486298 -0600
+@@ -241,7 +241,13 @@
+ var current = values[j].getAttribute('current');
+ nodes[id].values[k].value = new Array();
+ for (var l = 0; l < items.length; l++) {
+- nodes[id].values[k].value[l] = {item: items[l].firstChild.nodeValue, selected: (current == items[l].firstChild.nodeValue)};
++ var firstChild = items[l].firstChild;
++ var nodeValue;
++ if (firstChild == null)
++ nodeValue = '';
++ else
++ nodeValue = firstChild.nodeValue;
++ nodes[id].values[k].value[l] = {item: nodeValue, selected: (current == nodeValue)};
+ }
+ } else if (values[j].firstChild != null)
+ nodes[id].values[k].value = values[j].firstChild.nodeValue;
index 42082192..f16726f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -598,7 +598,7 @@ endif()
+@@ -682,7 +682,7 @@ endif()
IF(OpenZWave)
message(STATUS ${OpenZWave})
target_link_libraries(domoticz ${OpenZWave})
- include_directories(${CMAKE_SOURCE_DIR}/hardware/openzwave)
+ include_directories(${OPENZWAVE_INCLUDE_DIRS})
add_definitions(-DWITH_OPENZWAVE)
- # open-zwave needs libudev
- IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ # open-zwave needs libudev if statically linked
+ IF(USE_STATIC_OPENZWAVE)
diff --git a/hardware/openzwave/control_panel/ozwcp.cpp b/hardware/openzwave/control_panel/ozwcp.cpp
index ffd8d742..79c708ce 100644
--- a/hardware/openzwave/control_panel/ozwcp.cpp
#include <stdlib.h>
#include <time.h>
#include <string.h>
--#include "Options.h"
--#include "Manager.h"
--#include "Node.h"
--#include "Group.h"
--#include "Notification.h"
+-#include "../Options.h"
+-#include "../Manager.h"
+-#include "../Node.h"
+-#include "../Group.h"
+-#include "../Notification.h"
+#include <Options.h>
+#include <Manager.h>
+#include <Node.h>
--- /dev/null
+From 0d65f8fdcc320d8cc154c1a491a4984ef83a9040 Mon Sep 17 00:00:00 2001
+From: jowerg <jowerg@gmail.com>
+Date: Sat, 22 Apr 2017 08:45:11 -0400
+Subject: [PATCH] Initial COMMAND_CLASS_BARRIER_OPERATOR support
+
+---
+ .../openzwave/command_classes/BarrierOperator.h | 70 ++++++++++++++++++++++
+ 1 file changed, 70 insertions(+)
+ create mode 100644 hardware/openzwave/command_classes/BarrierOperator.h
+
+diff --git a/hardware/openzwave/command_classes/BarrierOperator.h b/hardware/openzwave/command_classes/BarrierOperator.h
+new file mode 100644
+index 000000000..0899304a1
+--- /dev/null
++++ b/hardware/openzwave/command_classes/BarrierOperator.h
+@@ -0,0 +1,70 @@
++//-----------------------------------------------------------------------------
++//
++// BarrierOperator.h
++//
++// Implementation of the COMMAND_CLASS_BARRIER_OPERATOR
++//
++// Copyright (c) 2016 srirams (https://github.com/srirams)
++//
++// SOFTWARE NOTICE AND LICENSE
++//
++// This file is part of OpenZWave.
++//
++// OpenZWave is free software: you can redistribute it and/or modify
++// it under the terms of the GNU Lesser General Public License as published
++// by the Free Software Foundation, either version 3 of the License,
++// or (at your option) any later version.
++//
++// OpenZWave is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU Lesser General Public License for more details.
++//
++// You should have received a copy of the GNU Lesser General Public License
++// along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
++//
++//-----------------------------------------------------------------------------
++
++#ifndef _BarrierOperator_H
++#define _BarrierOperator_H
++
++#include "command_classes/CommandClass.h"
++
++namespace OpenZWave
++{
++ class ValueByte;
++ class ValueBool;
++
++ /** \brief Implements COMMAND_CLASS_BARRIER_OPERATOR (0x66), a Z-Wave device command class.
++ * \ingroup CommandClass
++ */
++ class BarrierOperator: public CommandClass
++ {
++ public:
++ static CommandClass* Create( uint32 const _homeId, uint8 const _nodeId ){ return new BarrierOperator( _homeId, _nodeId ); }
++ virtual ~BarrierOperator(){}
++
++ static uint8 const StaticGetCommandClassId(){ return 0x66; }
++ static string const StaticGetCommandClassName(){ return "COMMAND_CLASS_BARRIER_OPERATOR"; }
++
++ // From CommandClass
++ virtual bool RequestState( uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue );
++ virtual bool RequestValue( uint32 const _requestFlags, uint8 const _index, uint8 const _instance, Driver::MsgQueue const _queue );
++ bool RequestSignalSupport( uint8 const _instance, Driver::MsgQueue const _queue );
++ virtual uint8 const GetCommandClassId()const{ return StaticGetCommandClassId(); }
++ virtual string const GetCommandClassName()const{ return StaticGetCommandClassName(); }
++ virtual bool HandleMsg( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 );
++ virtual bool SetValue(Value const& _value);
++
++ virtual uint8 GetMaxVersion(){ return 3; }
++
++ protected:
++ virtual void CreateVars( uint8 const _instance );
++
++ private:
++ BarrierOperator( uint32 const _homeId, uint8 const _nodeId );
++ };
++
++} // namespace OpenZWave
++
++#endif
Signed-off-by: Michael Cronenworth <mike@cchtml.com>
---
CMakeLists.txt | 57 +++++++++++++++++++++---------
- hardware/AnnaThermostat.cpp | 3 +-
- hardware/RAVEn.cpp | 3 +-
- hardware/openzwave/control_panel/ozwcp.cpp | 3 +-
- hardware/plugins/PluginManager.cpp | 3 +-
- hardware/plugins/Plugins.cpp | 3 +-
- main/LuaCommon.cpp | 7 +++-
- main/LuaHandler.cpp | 3 +-
+ removed from Fedora patch hardware/AnnaThermostat.cpp | 3 +-
+ removed from Fedora patch hardware/RAVEn.cpp | 3 +-
+ removed from Fedora patch hardware/openzwave/control_panel/ozwcp.cpp | 3 +-
+ removed from Fedora patch hardware/plugins/PluginManager.cpp | 3 +-
+ removed from Fedora patch hardware/plugins/Plugins.cpp | 3 +-
+ removed from Fedora patch main/LuaCommon.cpp | 7 +++-
+ removed from Fedora patch main/LuaHandler.cpp | 3 +-
removed from Fedora patch msbuild/domoticz.vcxproj | 6 ++--
9 files changed, 62 insertions(+), 26 deletions(-)
index bc231d8f6..334f203a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -451,22 +451,6 @@ webserver/proxyclient.cpp
+@@ -512,22 +512,6 @@
json/json_reader.cpp
json/json_value.cpp
json/json_writer.cpp
)
add_executable(domoticz ${domoticz_SRCS})
-@@ -538,6 +522,47 @@ else()
- MESSAGE(STATUS "==== LibUSB not found, support for TE923/Voltcraft disabled!")
- ENDIF(LIBUSB_FOUND)
+@@ -658,6 +642,47 @@
+ ENDIF(LIBUSB_FOUND)
+ endif(WITH_LIBUSB)
+option(USE_BUILTIN_TINYXPATH "Use builtin tinyxpath library" YES)
+IF(USE_BUILTIN_TINYXPATH)
+ ENDIF(TinyXML_FOUND)
+ENDIF(USE_BUILTIN_TINYXPATH)
+
- #
- # Find MD5/RMD160/SHA library
- #
-diff --git a/hardware/AnnaThermostat.cpp b/hardware/AnnaThermostat.cpp
-index 9c8cf26ef..9c91513ba 100644
---- a/hardware/AnnaThermostat.cpp
-+++ b/hardware/AnnaThermostat.cpp
-@@ -8,7 +8,8 @@
+ ## support lua popen on Linux platforms
+ #IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ # SET(OperatingSystem "Linux")
+--- a/hardware/OnkyoAVTCP.cpp 2018-06-23 09:18:06.000000000 -0500
++++ b/hardware/OnkyoAVTCP.cpp 2018-07-08 14:21:06.884163094 -0500
+@@ -3,16 +3,16 @@
+ #include "../main/Logger.h"
+ #include "../main/Helper.h"
#include "../main/SQLHelper.h"
- #include "../httpclient/HTTPClient.h"
- #include "../main/mainworker.h"
--#include "../tinyxpath/tinyxml.h"
-+
-+#include <tinyxml.h>
-
- #define round(a) ( int ) ( a + .5 )
-
-diff --git a/hardware/RAVEn.cpp b/hardware/RAVEn.cpp
-index 3ffe4f724..36f97bffb 100644
---- a/hardware/RAVEn.cpp
-+++ b/hardware/RAVEn.cpp
-@@ -6,7 +6,8 @@
- #include "../main/RFXtrx.h"
+-#include <iostream>
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
--#include "../tinyxpath/tinyxml.h"
-+
-+#include <tinyxml.h>
-
- //Rainforest RAVEn USB ZigBee Smart Meter Adapter
- //https://rainforestautomation.com/rfa-z106-raven/
-diff --git a/hardware/openzwave/control_panel/ozwcp.cpp b/hardware/openzwave/control_panel/ozwcp.cpp
-index 9a948c976..8fd4f77f0 100644
---- a/hardware/openzwave/control_panel/ozwcp.cpp
-+++ b/hardware/openzwave/control_panel/ozwcp.cpp
-@@ -45,11 +45,10 @@
- #include "Group.h"
- #include "Notification.h"
-
--#include "../../tinyxpath/tinyxml.h"
--
- #include <sys/stat.h>
- #include <fstream>
- #include <iostream>
-+#include <tinyxml.h>
-
- //#include "microhttpd.h"
- #include "ozwcp.h"
-diff --git a/hardware/plugins/PluginManager.cpp b/hardware/plugins/PluginManager.cpp
-index ea7bbe48a..9af41e42e 100644
---- a/hardware/plugins/PluginManager.cpp
-+++ b/hardware/plugins/PluginManager.cpp
-@@ -5,6 +5,8 @@
- //
- #ifdef ENABLE_PYTHON
-
-+#include <tinyxml.h>
-+
- #include "PluginManager.h"
- #include "Plugins.h"
- #include "PluginMessages.h"
-@@ -17,7 +19,6 @@
- #include "../main/mainworker.h"
- #include "../main/EventSystem.h"
+ #include "../hardware/hardwaretypes.h"
#include "../json/json.h"
-#include "../tinyxpath/tinyxml.h"
- #include "../main/localtime_r.h"
- #ifdef WIN32
- # include <direct.h>
-diff --git a/hardware/plugins/Plugins.cpp b/hardware/plugins/Plugins.cpp
-index dc2420d6a..8cba255a2 100644
---- a/hardware/plugins/Plugins.cpp
-+++ b/hardware/plugins/Plugins.cpp
-@@ -5,6 +5,8 @@
- //
- #ifdef ENABLE_PYTHON
+ #include "../main/WebServer.h"
++#include <iostream>
+ #include <sstream>
+ #include <map>
+#include <tinyxml.h>
-+
- #include "Plugins.h"
- #include "PluginMessages.h"
- #include "PluginProtocols.h"
-@@ -15,7 +17,6 @@
- #include "../main/Logger.h"
- #include "../main/SQLHelper.h"
- #include "../main/mainworker.h"
--#include "../tinyxpath/tinyxml.h"
- #include "../main/localtime_r.h"
- #include "../../notifications/NotificationHelper.h"
-diff --git a/main/LuaCommon.cpp b/main/LuaCommon.cpp
-index ec99429a5..76085aed6 100644
---- a/main/LuaCommon.cpp
-+++ b/main/LuaCommon.cpp
-@@ -16,7 +16,8 @@ extern "C" {
- #endif
- }
+ #define RETRY_DELAY 30
--#include "../tinyxpath/xpath_processor.h"
-+#include <xpath_processor.h>
-+
- #include "../json/json.h"
- #include "SQLHelper.h"
- #include "mainworker.h"
-@@ -44,7 +45,11 @@ int CLuaCommon::l_domoticz_applyXPath(lua_State* lua_state)
- return 0;
- }
- TinyXPath::xpath_processor processor(root, xpath.c_str());
-+#ifdef WITH_EXTERNAL_TINYXPATH
-+ TIXML_STRING xresult = processor.S_compute_xpath();
-+#else
- TiXmlString xresult = processor.S_compute_xpath();
-+#endif
- lua_pushstring(lua_state, xresult.c_str());
- return 1;
- }
-diff --git a/main/LuaHandler.cpp b/main/LuaHandler.cpp
-index 8fdcb278b..a66cafee7 100644
---- a/main/LuaHandler.cpp
-+++ b/main/LuaHandler.cpp
-@@ -16,7 +16,8 @@ extern "C" {
- #endif
- }
-
--#include "../tinyxpath/xpath_processor.h"
-+#include <xpath_processor.h>
-+
- #include "../json/json.h"
- #include "SQLHelper.h"
- #include "mainworker.h"
-#define APPVERSION 5876
-#define APPHASH "b97777b"
-#define APPDATE 1478691222
-+#define APPVERSION 8153
-+#define APPHASH "494fff7"
-+#define APPDATE 1501409981
++#define APPVERSION 9700
++#define APPHASH "2772d9f"
++#define APPDATE 1529763480
Summary: Open source Home Automation System
Name: domoticz
-Version: 3.8153
-Release: 0.1
+Version: 4.9700
+Release: 1
License: GPLv3+ and ASL 2.0 and Boost and BSD and MIT
Group: Base
URL: http://www.domoticz.com
Source0: https://github.com/domoticz/domoticz/archive/%{version}.tar.gz
-# Source0-md5: ad7b1d0491cd17e54bbe7368bcfd5170
+# Source0-md5: 726d838d5d80eed4335b0dfeefb2af6c
Source1: %{name}.service
Source2: %{name}.conf
# Source says its version 3.5876, but it's really 3.8153
Patch4: %{name}-openzwave-Dev.patch
# Fix python detection (https://github.com/domoticz/domoticz/pull/1749)
Patch5: %{name}-python.patch
+Patch6: domoticz-ozw-barrier-support-0002.patch
+Patch7: domoticz-cp-js.patch
BuildRequires: boost-devel
BuildRequires: cmake
BuildRequires: curl-devel
%patch3 -p1 -b.openzwave
%patch4 -p1 -b.openzwave-Dev
%patch5 -p1 -b.python
+%patch6 -p1
+%patch7 -p1
rm -f hardware/openzwave/*.h
rm -rf hardware/openzwave/aes
rm -rf hardware/openzwave/command_classes