mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Nanoleaf (#1647)
* Support Philips Hue APIv2 and refactoring * Fix MDNSBrower - if timeout during host resolvment occurs * Hue API v2 - Migrate database * Fix macOS build * Handle network timeout before any other error * Address CodeQL findings * Clean-up and Fixes * Only getProperties, if username is available * Option to layout by entertainment area center * Fix Wizard * Fix Nanoleaf, add user auth token wizard * Nanoleaf fixes and enhancements * Consider rotated panel layouts * Corrections * Layout corrections and filter for non LED panels * Add LED test effect lightening up LEDs in sequence * Align rotation value to 15 degree steps * Align rotation value to 15 degree steps * Skip non LED panels * Fix Rotation and refactoring --------- Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -87,6 +87,20 @@ public:
|
||||
///
|
||||
void identify(const QJsonObject& params) override;
|
||||
|
||||
/// @brief Add an API-token to the Nanoleaf device
|
||||
///
|
||||
/// Following parameters are required
|
||||
/// @code
|
||||
/// {
|
||||
/// "host" : "hostname or IP",
|
||||
/// }
|
||||
///@endcode
|
||||
///
|
||||
/// @param[in] params Parameters to query device
|
||||
/// @return A JSON structure holding the authorization keys
|
||||
///
|
||||
QJsonObject addAuthorization(const QJsonObject& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
///
|
||||
@@ -147,6 +161,27 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
// Nanoleaf Panel Shapetypes
|
||||
enum SHAPETYPES {
|
||||
TRIANGLE = 0,
|
||||
RHYTM = 1,
|
||||
SQUARE = 2,
|
||||
CONTROL_SQUARE_PRIMARY = 3,
|
||||
CONTROL_SQUARE_PASSIVE = 4,
|
||||
POWER_SUPPLY = 5,
|
||||
HEXAGON_SHAPES = 7,
|
||||
TRIANGE_SHAPES = 8,
|
||||
MINI_TRIANGE_SHAPES = 9,
|
||||
SHAPES_CONTROLLER = 12,
|
||||
ELEMENTS_HEXAGONS = 14,
|
||||
ELEMENTS_HEXAGONS_CORNER = 15,
|
||||
LINES_CONECTOR = 16,
|
||||
LIGHT_LINES = 17,
|
||||
LIGHT_LINES_SINGLZONE = 18,
|
||||
CONTROLLER_CAP = 19,
|
||||
POWER_CONNECTOR = 20
|
||||
};
|
||||
|
||||
///
|
||||
/// @brief Initialise the access to the REST-API wrapper
|
||||
///
|
||||
@@ -182,6 +217,20 @@ private:
|
||||
///
|
||||
QJsonArray discover();
|
||||
|
||||
///
|
||||
/// @brief Get number of panels that can be used as LEds.
|
||||
///
|
||||
/// @return Number of usable LED panels
|
||||
///
|
||||
int getHwLedCount(const QJsonObject& jsonLayout) const;
|
||||
|
||||
///
|
||||
/// @brief Check, if panelshape type has LEDs
|
||||
///
|
||||
/// @return True, if panel shape type has LEDs
|
||||
///
|
||||
bool hasLEDs(const SHAPETYPES& panelshapeType) const;
|
||||
|
||||
///REST-API wrapper
|
||||
ProviderRestApi* _restApi;
|
||||
int _apiPort;
|
||||
@@ -189,8 +238,6 @@ private:
|
||||
|
||||
bool _topDown;
|
||||
bool _leftRight;
|
||||
int _startPos;
|
||||
int _endPos;
|
||||
|
||||
//Nanoleaf device details
|
||||
QString _deviceModel;
|
||||
|
Reference in New Issue
Block a user