Update hueplusplus dependency to 1.2.0
This commit is contained in:
parent
bb6f8e2ddd
commit
0d6ae64b24
153 changed files with 305 additions and 23091 deletions
55
dependencies/hueplusplus-1.1.0/Jenkinsfile
vendored
55
dependencies/hueplusplus-1.1.0/Jenkinsfile
vendored
|
|
@ -1,55 +0,0 @@
|
|||
timestamps {
|
||||
node('master')
|
||||
{
|
||||
stage('SCM')
|
||||
{
|
||||
checkout scm
|
||||
}
|
||||
stage('Build')
|
||||
{
|
||||
sh returnStatus: true, script: 'rm -r build'
|
||||
sh '''#!/bin/bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -Dhueplusplus_TESTS=ON
|
||||
make -j8 2>&1 | tee buildlog.txt
|
||||
test ${PIPESTATUS[0]} -eq 0'''
|
||||
}
|
||||
stage('Test')
|
||||
{
|
||||
sh '''cd build
|
||||
hueplusplus/test/test_HuePlusPlus --gtest_output=xml:test.xml
|
||||
make -j8 coveragetest'''
|
||||
step([$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1,
|
||||
thresholds: [
|
||||
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: ''],
|
||||
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
|
||||
],
|
||||
tools: [
|
||||
[$class: 'GoogleTestType', deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/test.xml', skipNoTestFiles: false, stopProcessingIfError: true]
|
||||
]
|
||||
])
|
||||
publishHTML(
|
||||
[allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'build/coveragetest', reportFiles: 'index.html', reportName: 'Coveragetest', reportTitles: '']
|
||||
)
|
||||
}
|
||||
stage('CppCheck')
|
||||
{
|
||||
sh 'cppcheck -j 8 --force -ihueplusplus/test -ihueplusplus/jsoncpp.cpp hueplusplus/ 2>build/CppCheckResult'
|
||||
rtp nullAction: '1', parserName: 'HTML', stableText: '${FILE:build/CppCheckResult}'
|
||||
}
|
||||
stage('Documentation')
|
||||
{
|
||||
sh 'doxygen Doxyfile'
|
||||
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'doc/html/', reportFiles: 'index.html', reportName: 'Doxygen'])
|
||||
}
|
||||
stage('Parse warnings')
|
||||
{
|
||||
warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'Doxygen', pattern: 'doxylog.txt']], unHealthy: ''
|
||||
sh returnStatus: true, script: 'rm doxylog.txt'
|
||||
warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'GNU C Compiler 4 (gcc)', pattern: 'build/buildlog.txt']], unHealthy: ''
|
||||
sh returnStatus: true, script: 'rm build/buildlog.txt'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
22875
dependencies/hueplusplus-1.1.0/include/json/json.hpp
vendored
22875
dependencies/hueplusplus-1.1.0/include/json/json.hpp
vendored
File diff suppressed because it is too large
Load diff
12
dependencies/hueplusplus-1.2.0/.github/FUNDING.yml
vendored
Normal file
12
dependencies/hueplusplus-1.2.0/.github/FUNDING.yml
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [enwi]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
72
dependencies/hueplusplus-1.2.0/.github/workflows/build.yml
vendored
Normal file
72
dependencies/hueplusplus-1.2.0/.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- development
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
env:
|
||||
LINUX_DIST: bionic
|
||||
DEPS_DIR: ${{ github.workspace }}/deps
|
||||
COMPILER_NAME: gcc
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
RUN_TESTS: true
|
||||
COVERAGE: false
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
# PATH: ${{ github.workspace }}/deps/cmake/bin:${{ env.PATH }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up dependencies
|
||||
run: |
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y gcc g++ lcov doxygen graphviz python3-yaml
|
||||
|
||||
# - name: Install CodeCov and LCOV
|
||||
# run: |
|
||||
# sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90
|
||||
# wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz
|
||||
# tar xf lcov_1.13.orig.tar.gz
|
||||
# make -C lcov-1.13 "PREFIX=${HOME}/.local" install
|
||||
# echo "${HOME}/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Show tool versions
|
||||
run: |
|
||||
echo $PATH
|
||||
echo $CXX
|
||||
$CXX --version
|
||||
$CXX -v
|
||||
cmake --version
|
||||
lcov --version
|
||||
gcov --version
|
||||
|
||||
- name: Build project
|
||||
run: |
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. -Dhueplusplus_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -Dhueplusplus_EXAMPLES=ON
|
||||
make hueplusplus_examples hueplusplus_snippets
|
||||
make coveragetest
|
||||
cd ..
|
||||
doxygen Doxyfile
|
||||
touch doc/html/.nojekyll
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
run: |
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
- name: Deploy documentation to GitHub Pages
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./doc/html
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
[submodule "lib/mbedtls"]
|
||||
path = lib/mbedtls
|
||||
url = https://github.com/ARMmbed/mbedtls.git
|
||||
[submodule "lib/json"]
|
||||
path = lib/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
|
|
@ -1,15 +1,9 @@
|
|||
cmake_minimum_required(VERSION 3.8)
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.11)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
else()
|
||||
cmake_policy(VERSION 3.11)
|
||||
endif()
|
||||
cmake_minimum_required(VERSION 3.10.2...3.28)
|
||||
|
||||
# Add cmake dir to module path, so Find*.cmake can be found
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
project(hueplusplus VERSION 1.1.0 LANGUAGES CXX)
|
||||
project(hueplusplus VERSION 1.2.0 LANGUAGES CXX)
|
||||
|
||||
# check whether hueplusplus is compiled directly or included as a subdirectory
|
||||
if(NOT DEFINED hueplusplus_master_project)
|
||||
|
|
@ -23,6 +17,16 @@ endif()
|
|||
# options to set
|
||||
option(hueplusplus_TESTS "Build tests" OFF)
|
||||
option(hueplusplus_EXAMPLES "Build examples" OFF)
|
||||
option(hueplusplus_NO_EXTERNAL_LIBRARIES "Do not try to use external libraries" OFF)
|
||||
|
||||
# Try to find installed packages
|
||||
if(NOT hueplusplus_NO_EXTERNAL_LIBRARIES)
|
||||
# Suppress warnings if libraries are not found, they will be built from submodules
|
||||
find_package(MbedTLS QUIET)
|
||||
find_package(nlohmann_json QUIET)
|
||||
endif()
|
||||
|
||||
set(NEED_SUBMODULES NOT (${MbedTLS_FOUND} AND ${nlohmann_json_FOUND}))
|
||||
|
||||
option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
|
||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable")
|
||||
|
|
@ -38,7 +42,7 @@ endif()
|
|||
find_package(Git QUIET)
|
||||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
||||
option(GIT_SUBMODULE "Check submodules during build" ON)
|
||||
if(GIT_SUBMODULE)
|
||||
if(GIT_SUBMODULE AND NEED_SUBMODULES)
|
||||
message(STATUS "Submodule update")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
||||
|
|
@ -83,15 +87,34 @@ if (1 AND APPLE)
|
|||
set(CMAKE_MACOSX_RPATH 1)
|
||||
endif()
|
||||
|
||||
set(USE_STATIC_MBEDTLS_LIBRARY ON)
|
||||
set(USE_SHARED_MBEDTLS_LIBRARY OFF)
|
||||
add_subdirectory("lib/mbedtls" EXCLUDE_FROM_ALL)
|
||||
if(NOT MbedTLS_FOUND)
|
||||
# Build mbedtls if not installed
|
||||
message(STATUS "MbedTLS was not found, the submodule is used.")
|
||||
set(USE_STATIC_MBEDTLS_LIBRARY ON)
|
||||
set(USE_SHARED_MBEDTLS_LIBRARY OFF)
|
||||
add_subdirectory("lib/mbedtls" EXCLUDE_FROM_ALL)
|
||||
|
||||
# Compile the mbedtls library as a static with position independent code,
|
||||
# because we need it for both a shared and static library
|
||||
set_property(TARGET mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
set_property(TARGET mbedcrypto PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
set_property(TARGET mbedx509 PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
# Compile the mbedtls library as a static with position independent code,
|
||||
# because we need it for both a shared and static library
|
||||
set_property(TARGET mbedtls PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
set_property(TARGET mbedcrypto PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
set_property(TARGET mbedx509 PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
if(CMAKE_VERSION VERSION_LESS 3.18)
|
||||
# Aliases for compatibility with find_package, newer cmake versions add these already
|
||||
add_library(MbedTLS::mbedtls ALIAS mbedtls)
|
||||
add_library(MbedTLS::mbedcrypto ALIAS mbedcrypto)
|
||||
add_library(MbedTLS::mbedx509 ALIAS mbedx509)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT nlohmann_json_FOUND)
|
||||
# Use embedded json
|
||||
message(STATUS "nlohmann_json was not found, the submodule is used.")
|
||||
# disable tests for json
|
||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||
add_subdirectory("lib/json" EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ PROJECT_NAME = hueplusplus
|
|||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.0.0
|
||||
PROJECT_NUMBER = 1.2.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
# hueplusplus
|
||||
A simple and easy to use library for Philips Hue Lights
|
||||
|
||||
| Branch | Travis CI | Codecov | LGTM
|
||||
| Branch | CI | Codecov | LGTM
|
||||
|:-|:-|:-|:-|
|
||||
| [Master](https://github.com/enwi/hueplusplus/tree/master) | [](https://travis-ci.com/enwi/hueplusplus) | [](https://codecov.io/gh/enwi/hueplusplus) | [](https://lgtm.com/projects/g/enwi/hueplusplus/context:cpp) |
|
||||
| [Development](https://github.com/enwi/hueplusplus/tree/development) | [](https://travis-ci.com/enwi/hueplusplus) | [](https://codecov.io/gh/enwi/hueplusplus) | |
|
||||
| [Master](https://github.com/enwi/hueplusplus/tree/master) | [](https://github.com/enwi/hueplusplus/actions/workflows/build.yml)| [](https://codecov.io/gh/enwi/hueplusplus) | [](https://lgtm.com/projects/g/enwi/hueplusplus/context:cpp) |
|
||||
| [Development](https://github.com/enwi/hueplusplus/tree/development) | [](https://github.com/enwi/hueplusplus/actions/workflows/build.yml) | [](https://codecov.io/gh/enwi/hueplusplus) | |
|
||||
|
||||
## Features
|
||||
* find bridges with SSDP or set an ip manually
|
||||
|
|
@ -18,7 +18,7 @@ When you want to update the library for a new version, use pull with rebase.
|
|||
```
|
||||
|
||||
## Build with CMake {#build-cmake}
|
||||
To build the library, you need to use [CMake](https://cmake.org) version 3.8 or higher.
|
||||
To build the library, you need to use [CMake](https://cmake.org) version 3.10 or higher.
|
||||
It is easiest to create a separate build directory where the build files are stored.
|
||||
```{.sh}
|
||||
~/hueplusplus $ mkdir build
|
||||
|
|
@ -84,3 +84,7 @@ cd build
|
|||
cmake .. -Dhueplusplus_EXAMPLES=ON
|
||||
make hueplusplus_examples
|
||||
```
|
||||
|
||||
## External libraries
|
||||
Hueplusplus requires a few external libraries (e.g. Mbed TLS and GTest), which are included automatically. If these are pre-installed on your system, those versions will be used by default. This can potentially cause issues if your installed versions are incompatible.
|
||||
In this case, set `hueplusplus_NO_EXTERNAL_LIBRARIES=ON` to force using the embedded versions instead of the installed libraries.
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef INCLUDE_HUEPLUSPLUS_ACTION_H
|
||||
#define INCLUDE_HUEPLUSPLUS_ACTION_H
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "APICache.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "IHttpHandler.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
#include "SensorList.h"
|
||||
#include "Utils.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
//! \brief Namespace for the hueplusplus library
|
||||
namespace hueplusplus
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "TimePattern.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include "HueCommandAPI.h"
|
||||
#include "StateTransaction.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include "HueCommandAPI.h"
|
||||
#include "StateTransaction.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "BaseHttpHandler.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "TimePattern.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <json/json.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "APICache.h"
|
||||
#include "ColorUnits.h"
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
#include "HueCommandAPI.h"
|
||||
#include "TimePattern.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
#include "ColorUnits.h"
|
||||
#include "HueCommandAPI.h"
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#ifndef INCLUDE_HUEPLUSPLUS_UTILS_H
|
||||
#define INCLUDE_HUEPLUSPLUS_UTILS_H
|
||||
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "hueplusplus/HueExceptionMacro.h"
|
||||
#include "hueplusplus/Utils.h"
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -57,20 +57,33 @@ foreach(src ${hueplusplus_SOURCES})
|
|||
endforeach()
|
||||
set(hueplusplus_SOURCES ${_srcList} PARENT_SCOPE)
|
||||
|
||||
# For install dir variables
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# hueplusplus shared library
|
||||
add_library(hueplusplusshared SHARED ${hueplusplus_SOURCES})
|
||||
target_link_libraries(hueplusplusshared PRIVATE mbedtls)
|
||||
target_link_libraries(hueplusplusshared PRIVATE MbedTLS::mbedtls)
|
||||
target_link_libraries(hueplusplusshared PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_features(hueplusplusshared PUBLIC cxx_std_14)
|
||||
target_include_directories(hueplusplusshared PUBLIC $<BUILD_INTERFACE:${hueplusplus_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
install(TARGETS hueplusplusshared DESTINATION lib)
|
||||
|
||||
|
||||
# hueplusplus static library
|
||||
add_library(hueplusplusstatic STATIC ${hueplusplus_SOURCES})
|
||||
target_link_libraries(hueplusplusstatic PRIVATE mbedtls)
|
||||
target_link_libraries(hueplusplusstatic PRIVATE MbedTLS::mbedtls)
|
||||
target_link_libraries(hueplusplusstatic PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_features(hueplusplusstatic PUBLIC cxx_std_14)
|
||||
install(TARGETS hueplusplusstatic DESTINATION lib)
|
||||
if(NOT WIN32)
|
||||
# On windows, a shared library will also generate a .lib import library, making different names necessary.
|
||||
# On other platforms the file endings are different, so the names can be the same.
|
||||
set_target_properties(hueplusplusshared PROPERTIES OUTPUT_NAME hueplusplus SOVERSION 1)
|
||||
set_target_properties(hueplusplusstatic PROPERTIES OUTPUT_NAME hueplusplus)
|
||||
endif()
|
||||
|
||||
install(TARGETS hueplusplusshared DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(TARGETS hueplusplusstatic DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
target_include_directories(hueplusplusstatic PUBLIC $<BUILD_INTERFACE:${hueplusplus_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/" DESTINATION include)
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
# Export the package for use from the build-tree
|
||||
# (this registers the build-tree with a global CMake-registry)
|
||||
|
|
@ -21,7 +21,6 @@
|
|||
**/
|
||||
|
||||
#include "hueplusplus/EntertainmentMode.h"
|
||||
#include "mbedtls/certs.h"
|
||||
#include "mbedtls/ctr_drbg.h"
|
||||
#include "mbedtls/debug.h"
|
||||
#include "mbedtls/entropy.h"
|
||||
|
|
@ -30,6 +29,8 @@
|
|||
#include "mbedtls/ssl.h"
|
||||
#include "mbedtls/timing.h"
|
||||
|
||||
#include "hueplusplus/HueExceptionMacro.h"
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
constexpr uint8_t HUE_ENTERTAINMENT_HEADER_SIZE = 16;
|
||||
|
|
@ -121,7 +122,16 @@ EntertainmentMode::EntertainmentMode(Bridge& b, Group& g)
|
|||
/*-------------------------------------------------*\
|
||||
| Seed the Deterministic Random Bit Generator (RNG) |
|
||||
\*-------------------------------------------------*/
|
||||
int ret = mbedtls_ctr_drbg_seed(&tls_context->ctr_drbg, mbedtls_entropy_func, &tls_context->entropy, NULL, 0);
|
||||
if (mbedtls_ctr_drbg_seed(&tls_context->ctr_drbg, mbedtls_entropy_func, &tls_context->entropy, NULL, 0) != 0)
|
||||
{
|
||||
mbedtls_entropy_free(&tls_context->entropy);
|
||||
mbedtls_ctr_drbg_free(&tls_context->ctr_drbg);
|
||||
mbedtls_x509_crt_free(&tls_context->cacert);
|
||||
mbedtls_ssl_config_free(&tls_context->conf);
|
||||
mbedtls_ssl_free(&tls_context->ssl);
|
||||
mbedtls_net_free(&tls_context->server_fd);
|
||||
throw HueException(CURRENT_FILE_INFO, "Failed to seed mbedtls RNG");
|
||||
}
|
||||
}
|
||||
|
||||
EntertainmentMode::~EntertainmentMode()
|
||||
|
|
@ -267,10 +267,7 @@ nlohmann::json CreateGroup::getRequest() const
|
|||
{
|
||||
result["name"] = name;
|
||||
}
|
||||
if (!roomType.empty())
|
||||
{
|
||||
result["class"] = roomType;
|
||||
}
|
||||
result["class"] = roomType.empty() ? "Other" : roomType;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#include "hueplusplus/HueExceptionMacro.h"
|
||||
#include "hueplusplus/Light.h"
|
||||
#include "hueplusplus/Utils.h"
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -369,7 +369,7 @@ CreateScene& CreateScene::setLightIds(const std::vector<int>& ids)
|
|||
|
||||
CreateScene& CreateScene::setRecycle(bool recycle)
|
||||
{
|
||||
request["recycle"] = true;
|
||||
request["recycle"] = recycle;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "hueplusplus/HueExceptionMacro.h"
|
||||
#include "hueplusplus/Utils.h"
|
||||
#include "json/json.hpp"
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace hueplusplus
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ bool SimpleColorHueStrategy::setColorXY(const XYBrightness& xy, uint8_t transiti
|
|||
|
||||
bool SimpleColorHueStrategy::setColorLoop(bool on, Light& light) const
|
||||
{
|
||||
return light.transaction().setColorLoop(true).commit();
|
||||
return light.transaction().setColorLoop(on).commit();
|
||||
}
|
||||
|
||||
bool SimpleColorHueStrategy::alertHueSaturation(const HueSaturation& hueSat, Light& light) const
|
||||
|
|
@ -130,14 +130,14 @@ std::string durationTo_hh_mm_ss(std::chrono::system_clock::duration duration)
|
|||
{
|
||||
throw HueException(CURRENT_FILE_INFO, "Duration parameter longer than 1 day");
|
||||
}
|
||||
int numH = static_cast<int>(duration_cast<hours>(duration).count());
|
||||
unsigned int numH = static_cast<unsigned int>(duration_cast<hours>(duration).count());
|
||||
duration -= hours(numH);
|
||||
int numM = static_cast<int>(duration_cast<minutes>(duration).count());
|
||||
unsigned int numM = static_cast<unsigned int>(duration_cast<minutes>(duration).count());
|
||||
duration -= minutes(numM);
|
||||
int numS = static_cast<int>(duration_cast<seconds>(duration).count());
|
||||
unsigned int numS = static_cast<unsigned int>(duration_cast<seconds>(duration).count());
|
||||
|
||||
char result[9];
|
||||
std::sprintf(result, "%02d:%02d:%02d", numH, numM, numS);
|
||||
std::snprintf(result, 9, "%02u:%02u:%02u", numH, numM, numS);
|
||||
return std::string(result);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue