diff --git a/boblight/README.md b/boblight/README.md
deleted file mode 100644
index 8e117ad7..00000000
--- a/boblight/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Boblight
-
-This plugin allows to communicate with a [Boblight server](https://code.google.com/p/boblight/)
-
-The boblight server needs to be installed and running. In nymea it is required to setup the Boblight server connection first, during the setup you can configure how many channels you want to add. Each channel will appear auotamtically as an own device insided nymea. Default configuration for the Boblight server is `localhost:19333`, you can change the parameters during device setup.
-
-Once the Boblight devices are added you can control them like any other color light in nymea.
-
-
-## Supported Things
-
-* Boblight Server
- * Gateway device
- * Define channel count
-* Boblight Channel
- * Color light
- * Set color
- * Set color temperature
- * Set brightness
- * Set power
-
-**Generall**
-
-* No internet connection required
-
-## Requirements
-
-* Boblight server running on `localhost:19333` or any other reachable IP address.
-* Boblight device connected to the Boblight server.
-* The package "nymea-plugin-boblight" must be installed.
-
-## More
-
-For more information regarding the project please visit the [project site](https://sites.google.com/site/wikikrautbox/krautbox/hardware/boblight).
diff --git a/boblight/bobchannel.cpp b/boblight/bobchannel.cpp
deleted file mode 100644
index 2e96280e..00000000
--- a/boblight/bobchannel.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "bobchannel.h"
-
-BobChannel::BobChannel(const int &id, QObject *parent) :
- QObject(parent),
- m_id(id)
-{
- m_animation = new QPropertyAnimation(this, "finalColor", this);
- m_animation->setDuration(500);
-}
-
-int BobChannel::id() const
-{
- return m_id;
-}
-
-QColor BobChannel::color() const
-{
- return m_color;
-}
-
-void BobChannel::setColor(const QColor &color)
-{
- if (m_animation->state() == QPropertyAnimation::Running) {
- m_animation->stop();
- m_finalColor = m_color;
- }
-
- m_color = color;
- emit colorChanged();
-
- m_animation->setStartValue(m_finalColor);
- m_animation->setEndValue(color);
- m_animation->start();
-}
-
-bool BobChannel::power() const
-{
- return m_power;
-}
-
-void BobChannel::setPower(bool power)
-{
- if (power != m_power) {
- m_power = power;
- emit powerChanged();
-
- if (m_animation->state() == QPropertyAnimation::Running) {
- m_animation->stop();
- }
-
- QColor target = m_color;
- target.setAlpha(target.alpha() * (m_power ? 1 : 0));
- m_animation->setStartValue(m_finalColor);
- m_animation->setEndValue(target);
- m_animation->start();
- }
-}
-
-QColor BobChannel::finalColor() const
-{
- return m_finalColor;
-}
-
-void BobChannel::setFinalColor(const QColor &color)
-{
- m_finalColor = color;
- emit finalColorChanged();
-}
-
diff --git a/boblight/bobchannel.h b/boblight/bobchannel.h
deleted file mode 100644
index 4bda1627..00000000
--- a/boblight/bobchannel.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifndef BOBCHANNEL_H
-#define BOBCHANNEL_H
-
-#include
-#include
-#include
-
-class BobChannel : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(bool power READ power WRITE setPower NOTIFY powerChanged)
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
-
- // don't directly write to this, the propertyAnimation requires a writable property tho...
- Q_PROPERTY(QColor finalColor READ finalColor WRITE setFinalColor NOTIFY finalColorChanged)
-
-public:
- explicit BobChannel(const int &id, QObject *parent = 0);
-
- int id() const;
-
- QColor color() const;
- void setColor(const QColor &color);
-
- bool power() const;
- void setPower(bool power);
-
- QColor finalColor() const;
- void setFinalColor(const QColor &color);
-
-private:
- QPropertyAnimation *m_animation;
- int m_id;
- bool m_power = false;
- QColor m_color = Qt::white;
- QColor m_finalColor = Qt::black;
-
-signals:
- void colorChanged();
- void brightnessChanged();
- void finalColorChanged();
- void powerChanged();
-
-};
-
-#endif // BOBCHANNEL_H
diff --git a/boblight/bobclient.cpp b/boblight/bobclient.cpp
deleted file mode 100644
index 8441cd7f..00000000
--- a/boblight/bobclient.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "bobclient.h"
-#include "extern-plugininfo.h"
-
-#include "libboblight/boblight.h"
-
-#include
-#include
-
-BobClient::BobClient(const QString &host, const int &port, QObject *parent) :
- QObject(parent),
- m_host(host),
- m_port(port),
- m_connected(false)
-{
- m_syncTimer = new QTimer(this);
- m_syncTimer->setSingleShot(false);
- m_syncTimer->setInterval(25);
-
- connect(m_syncTimer, SIGNAL(timeout()), this, SLOT(sync()));
-}
-
-BobClient::~BobClient()
-{
- if (m_boblight) {
- boblight_destroy(m_boblight);
- }
-}
-
-bool BobClient::connectToBoblight()
-{
- if (connected()) {
- return true;
- }
- m_boblight = boblight_init();
-
- //try to connect, if we can't then bitch to stderr and destroy boblight
- if (!boblight_connect(m_boblight, m_host.toLatin1().data(), m_port, 1000000)) {
- qCWarning(dcBoblight) << "Failed to connect:" << boblight_geterror(m_boblight);
- boblight_destroy(m_boblight);
- m_boblight = nullptr;
- setConnected(false);
- return false;
- }
-
- qCDebug(dcBoblight) << "Connected to boblightd successfully.";
- boblight_setpriority(m_boblight, m_priority);
- for (int i = 0; i < lightsCount(); ++i) {
- BobChannel *channel = new BobChannel(i, this);
- channel->setColor(QColor(255,255,255,0));
- connect(channel, SIGNAL(colorChanged()), this, SLOT(sync()));
- m_channels.insert(i, channel);
- }
- setConnected(true);
- return true;
-}
-
-bool BobClient::connected()
-{
- return m_connected;
-}
-
-void BobClient::setPriority(int priority)
-{
- m_priority = priority;
- if (connected()) {
- qCDebug(dcBoblight) << "setting priority to" << priority;
- boblight_setpriority(m_boblight, priority);
- }
- emit priorityChanged(priority);
-}
-
-void BobClient::setPower(int channel, bool power)
-{
- qCDebug(dcBoblight()) << "BobClient: setPower" << channel << power;
- m_channels.value(channel)->setPower(power);
- emit powerChanged(channel, power);
-}
-
-BobChannel *BobClient::getChannel(const int &id)
-{
- foreach (BobChannel *channel, m_channels) {
- if (channel->id() == id)
- return channel;
- }
- return nullptr;
-}
-
-void BobClient::setColor(int channel, QColor color)
-{
- if (channel == -1) {
- for (int i = 0; i < lightsCount(); ++i) {
- setColor(i, color);
- }
- } else {
- BobChannel *c = getChannel(channel);
- if (c) {
- c->setColor(color);
- qCDebug(dcBoblight) << "set channel" << channel << "to color" << color;
- emit colorChanged(channel, color);
- }
- }
-}
-
-void BobClient::setBrightness(int channel, int brightness)
-{
- QColor color = m_channels.value(channel)->color();
- color.setAlpha(qRound(brightness * 255.0 / 100));
- m_channels.value(channel)->setColor(color);
- emit brightnessChanged(channel, brightness);
-
- if (brightness > 0) {
- m_channels.value(channel)->setPower(true);
- emit powerChanged(channel, true);
- }
-}
-
-void BobClient::sync()
-{
- if (!m_connected)
- return;
-
- foreach (BobChannel *channel, m_channels) {
- int rgb[3];
- rgb[0] = channel->finalColor().red() * channel->finalColor().alphaF();
- rgb[1] = channel->finalColor().green() * channel->finalColor().alphaF();
- rgb[2] = channel->finalColor().blue() * channel->finalColor().alphaF();
- boblight_addpixel(m_boblight, channel->id(), rgb);
- }
-
- if (!boblight_sendrgb(m_boblight, 1, nullptr)) {
- qCWarning(dcBoblight) << "Boblight connection error:" << boblight_geterror(m_boblight);
- boblight_destroy(m_boblight);
- qDeleteAll(m_channels);
- m_channels.clear();
- setConnected(false);
- }
-}
-
-void BobClient::setConnected(bool connected)
-{
- m_connected = connected;
- emit connectionChanged();
-
- // if disconnected, delete all channels
- if (!connected) {
- m_syncTimer->stop();
- qDeleteAll(m_channels);
- } else {
- m_syncTimer->start();
- }
-}
-
-int BobClient::lightsCount()
-{
- return boblight_getnrlights(m_boblight);
-}
-
-QColor BobClient::currentColor(const int &channel)
-{
- return getChannel(channel)->color();
-}
diff --git a/boblight/bobclient.h b/boblight/bobclient.h
deleted file mode 100644
index 2f29ac4c..00000000
--- a/boblight/bobclient.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifndef BOBCLIENT_H
-#define BOBCLIENT_H
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-class BobClient : public QObject
-{
- Q_OBJECT
-public:
- explicit BobClient(const QString &host = "127.0.0.1", const int &port = 19333, QObject *parent = nullptr);
- ~BobClient();
-
- bool connectToBoblight();
- bool connected();
-
- int lightsCount();
- QColor currentColor(const int &channel);
-
- void setPriority(int priority);
-
- void setPower(int channel, bool power);
- void setColor(int channel, QColor color);
- void setBrightness(int channel, int brightness);
-
-private:
- void *m_boblight = nullptr;
-
- QTimer *m_syncTimer;
- QString m_host;
- int m_port;
- bool m_connected;
- int m_priority = 128;
-
- QMap m_colors;
- QMap m_channels;
-
- BobChannel *getChannel(const int &id);
-
-
-private slots:
- void sync();
- void setConnected(bool connected);
-
-signals:
- void connectionChanged();
- void powerChanged(int channel, bool power);
- void brightnessChanged(int channel, int brightness);
- void colorChanged(int channel, const QColor &color);
- void priorityChanged(int priority);
-};
-
-#endif // BOBCLIENT_H
diff --git a/boblight/boblight.png b/boblight/boblight.png
deleted file mode 100644
index acee03d0..00000000
Binary files a/boblight/boblight.png and /dev/null differ
diff --git a/boblight/boblight.pro b/boblight/boblight.pro
deleted file mode 100644
index 70c58d36..00000000
--- a/boblight/boblight.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-include(../plugins.pri)
-
-QT += dbus bluetooth concurrent
-
-CONFIG += c++11
-
-TARGET = $$qtLibraryTarget(nymea_integrationpluginboblight)
-LIBS += -lboblight
-
-SOURCES += \
- integrationpluginboblight.cpp \
- bobclient.cpp \
- bobchannel.cpp
-
-HEADERS += \
- integrationpluginboblight.h \
- bobclient.h \
- bobchannel.h
-
-
diff --git a/boblight/integrationpluginboblight.cpp b/boblight/integrationpluginboblight.cpp
deleted file mode 100644
index 86af2e6a..00000000
--- a/boblight/integrationpluginboblight.cpp
+++ /dev/null
@@ -1,297 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#include "integrationpluginboblight.h"
-
-#include "integrations/thing.h"
-
-#include "bobclient.h"
-#include "plugininfo.h"
-#include "plugintimer.h"
-
-#include
-#include
-#include
-
-IntegrationPluginBoblight::IntegrationPluginBoblight()
-{
-}
-
-void IntegrationPluginBoblight::init()
-{
- m_pluginTimer = hardwareManager()->pluginTimerManager()->registerTimer(15);
- connect(m_pluginTimer, &PluginTimer::timeout, this, &IntegrationPluginBoblight::guhTimer);
-}
-
-void IntegrationPluginBoblight::thingRemoved(Thing *thing)
-{
- BobClient *client = m_bobClients.take(thing->id());
- if (thing->thingClassId() == boblightServerThingClassId) {
- client->deleteLater();
- }
-}
-
-void IntegrationPluginBoblight::startMonitoringAutoThings()
-{
- m_canCreateAutoDevices = true;
- qCDebug(dcBoblight()) << "Populating auto devices" << myThings().count();
- QHash parentDevices;
- QHash deviceIds;
- foreach (Thing *thing, myThings()) {
- deviceIds.insert(thing->id(), thing);
- if (thing->thingClassId() == boblightServerThingClassId) {
-// qWarning() << "Device" << thing->id() << "is bridge";
- if (!parentDevices.contains(thing->id())) {
- parentDevices[thing->id()] = 0;
- }
- } else if (thing->thingClassId() == boblightThingClassId) {
-// qWarning() << "Device" << thing->id() << "is child to bridge" << thing->parentId();
- parentDevices[thing->parentId()] += 1;
- }
- }
- QList descriptors;
- foreach (const ThingId &id, parentDevices.keys()) {
- if (parentDevices.value(id) < deviceIds.value(id)->paramValue(boblightServerThingChannelsParamTypeId).toInt()) {
- for (int i = parentDevices.value(id); i < deviceIds.value(id)->paramValue(boblightServerThingChannelsParamTypeId).toInt(); i++) {
- ThingDescriptor descriptor(boblightThingClassId, deviceIds.value(id)->name() + " " + QString::number(i + 1), QString(), id);
- descriptor.setParams(ParamList() << Param(boblightThingChannelParamTypeId, i));
- qCDebug(dcBoblight()) << "Adding new boblight channel" << i + 1;
- descriptors.append(descriptor);
- }
- }
- }
- if (!descriptors.isEmpty()) {
- emit autoThingsAppeared(descriptors);
- }
-}
-
-void IntegrationPluginBoblight::guhTimer()
-{
- foreach (BobClient *client, m_bobClients) {
- if (!client->connected()) {
- client->connectToBoblight();
- }
- }
-}
-
-void IntegrationPluginBoblight::onPowerChanged(int channel, bool power)
-{
- qCDebug(dcBoblight()) << "power changed" << channel << power;
- BobClient *sndr = dynamic_cast(sender());
- foreach (Thing* thing, myThings()) {
- if (m_bobClients.value(thing->parentId()) == sndr && thing->paramValue(boblightThingChannelParamTypeId).toInt() == channel) {
- qCDebug(dcBoblight()) << "setting state power" << power;
- thing->setStateValue(boblightPowerStateTypeId, power);
- }
- }
-}
-
-void IntegrationPluginBoblight::onBrightnessChanged(int channel, int brightness)
-{
- BobClient *sndr = dynamic_cast(sender());
- foreach (Thing* thing, myThings()) {
- if (m_bobClients.value(thing->parentId()) == sndr && thing->paramValue(boblightThingChannelParamTypeId).toInt() == channel) {
- thing->setStateValue(boblightBrightnessStateTypeId, brightness);
- }
- }
-}
-
-void IntegrationPluginBoblight::onColorChanged(int channel, const QColor &color)
-{
- BobClient *sndr = dynamic_cast(sender());
- foreach (Thing* thing, myThings()) {
- if (m_bobClients.value(thing->parentId()) == sndr && thing->paramValue(boblightThingChannelParamTypeId).toInt() == channel) {
- thing->setStateValue(boblightColorStateTypeId, color);
- }
- }
-}
-
-void IntegrationPluginBoblight::onPriorityChanged(int priority)
-{
- BobClient *sndr = dynamic_cast(sender());
- foreach (Thing* thing, myThings()) {
- if (thing->thingClassId() == boblightServerThingClassId && m_bobClients.value(thing->id()) == sndr) {
- thing->setStateValue(boblightServerPriorityStateTypeId, priority);
- }
- }
-}
-
-QColor IntegrationPluginBoblight::tempToRgb(int temp)
-{
- // 153 cold: 0.839216, 1, 0.827451
- // 500 warm: 0.870588, 1, 0.266667
-
- // => 0 : 214,255,212
- // 100 : 222,255,67
-
- // r => 0 : 214 = 100 : 222
- // => temp : (x-214) = 100 : (255 - 214)
- // => x = temp * (255-214) / 100
- // r = x + 214
-
- int red = temp * 41 / 100 + 214;
-
- int green = 255;
-
- // b => 0 : 212 = 100 : 67
- // => temp : (212 - x) = 100 : (212 - 145)
- // => x = temp * 145 / 100
- // g = 212 - x
-
- int blue = 212 - temp * 145 / 100;
-
- qWarning() << "temp:" << temp << "rgb" << red << green << blue;
- return QColor(red, green, blue);
-}
-
-void IntegrationPluginBoblight::setupThing(ThingSetupInfo *info)
-{
- Thing *thing = info->thing();
-
- if (thing->thingClassId() == boblightServerThingClassId) {
-
- BobClient *bobClient = new BobClient(thing->paramValue(boblightServerThingHostAddressParamTypeId).toString(), thing->paramValue(boblightServerThingPortParamTypeId).toInt(), this);
- bool connected = bobClient->connectToBoblight();
- if (!connected) {
- qCWarning(dcBoblight()) << "Error connecting to boblight on" << thing->paramValue(boblightServerThingHostAddressParamTypeId).toString();
- } else {
- qCDebug(dcBoblight()) << "Connected to boblight";
- }
- bobClient->setPriority(thing->stateValue(boblightServerPriorityStateTypeId).toInt());
- thing->setStateValue(boblightServerConnectedStateTypeId, connected);
- m_bobClients.insert(thing->id(), bobClient);
- connect(bobClient, &BobClient::connectionChanged, this, &IntegrationPluginBoblight::onConnectionChanged);
- connect(bobClient, &BobClient::powerChanged, this, &IntegrationPluginBoblight::onPowerChanged);
- connect(bobClient, &BobClient::brightnessChanged, this, &IntegrationPluginBoblight::onBrightnessChanged);
- connect(bobClient, &BobClient::colorChanged, this, &IntegrationPluginBoblight::onColorChanged);
- connect(bobClient, &BobClient::priorityChanged, this, &IntegrationPluginBoblight::onPriorityChanged);
- } else if (thing->thingClassId() == boblightThingClassId) {
- BobClient *bobClient = m_bobClients.value(thing->parentId());
- thing->setStateValue(boblightConnectedStateTypeId, bobClient->connected());
- m_bobClients.insert(thing->id(), bobClient);
- }
-
- info->finish(Thing::ThingErrorNoError);
-}
-
-void IntegrationPluginBoblight::postSetupThing(Thing *thing)
-{
- if (thing->thingClassId() == boblightServerThingClassId && m_canCreateAutoDevices) {
- startMonitoringAutoThings();
- }
- if (thing->thingClassId() == boblightThingClassId) {
- BobClient *bobClient = m_bobClients.value(thing->parentId());
- if (bobClient && bobClient->connected()) {
- thing->setStateValue(boblightConnectedStateTypeId, bobClient->connected());
-
- QColor color = thing->stateValue(boblightColorStateTypeId).value();
- int brightness = thing->stateValue(boblightBrightnessStateTypeId).toInt();
- bool power = thing->stateValue(boblightPowerStateTypeId).toBool();
-
- bobClient->setColor(thing->paramValue(boblightThingChannelParamTypeId).toInt(), color);
- bobClient->setBrightness(thing->paramValue(boblightThingChannelParamTypeId).toInt(), brightness);
- bobClient->setPower(thing->paramValue(boblightThingChannelParamTypeId).toInt(), power);
-
- }
- }
-}
-
-void IntegrationPluginBoblight::executeAction(ThingActionInfo *info)
-{
- Thing *thing = info->thing();
- Action action = info->action();
-
- qCDebug(dcBoblight()) << "Execute action for boblight" << action.params();
- if (thing->thingClassId() == boblightServerThingClassId) {
- BobClient *bobClient = m_bobClients.value(thing->id());
- if (!bobClient || !bobClient->connected()) {
- qCWarning(dcBoblight()) << "Boblight on" << thing->paramValue(boblightServerThingHostAddressParamTypeId).toString() << "not connected";
- info->finish(Thing::ThingErrorHardwareNotAvailable);
- return;
- }
-
- if (action.actionTypeId() == boblightServerPriorityActionTypeId) {
- bobClient->setPriority(action.param(boblightServerPriorityActionPriorityParamTypeId).value().toInt());
- info->finish(Thing::ThingErrorNoError);
- return;
- }
- qCWarning(dcBoblight()) << "Unhandled action" << action.actionTypeId() << "for BoblightServer" << info;
- info->finish(Thing::ThingErrorActionTypeNotFound);
- return;
- }
-
- if (thing->thingClassId() == boblightThingClassId) {
- BobClient *bobClient = m_bobClients.value(thing->parentId());
- if (!bobClient || !bobClient->connected()) {
- qCWarning(dcBoblight()) << "Boblight not connected";
- info->finish(Thing::ThingErrorHardwareNotAvailable);
- return;
- }
-
- if (action.actionTypeId() == boblightPowerActionTypeId) {
- bobClient->setPower(thing->paramValue(boblightThingChannelParamTypeId).toInt(), action.param(boblightPowerActionPowerParamTypeId).value().toBool());
- info->finish(Thing::ThingErrorNoError);
- return;
- }
- if (action.actionTypeId() == boblightColorActionTypeId) {
- bobClient->setColor(thing->paramValue(boblightThingChannelParamTypeId).toInt(), action.param(boblightColorActionColorParamTypeId).value().value());
- info->finish(Thing::ThingErrorNoError);
- return;
- }
- if (action.actionTypeId() == boblightBrightnessActionTypeId) {
- bobClient->setBrightness(thing->paramValue(boblightThingChannelParamTypeId).toInt(), action.param(boblightBrightnessActionBrightnessParamTypeId).value().toInt());
- info->finish(Thing::ThingErrorNoError);
- return;
- }
- if (action.actionTypeId() == boblightColorTemperatureActionTypeId) {
- bobClient->setColor(thing->paramValue(boblightThingChannelParamTypeId).toInt(), tempToRgb(action.param(boblightColorTemperatureActionColorTemperatureParamTypeId).value().toInt()));
- info->finish(Thing::ThingErrorNoError);
- return;
- }
- info->finish(Thing::ThingErrorActionTypeNotFound);
- return;
- }
- info->finish(Thing::ThingErrorThingClassNotFound);
-}
-
-void IntegrationPluginBoblight::onConnectionChanged()
-{
- BobClient *bobClient = static_cast(sender());
- qCDebug(dcBoblight()) << "Connection changed. BobClient:" << bobClient << bobClient->connected() << m_bobClients.keys(bobClient);
- foreach (const ThingId &thingId, m_bobClients.keys(bobClient)) {
- foreach (Thing *thing, myThings()) {
- if (thing->id() == thingId || thing->parentId() == thingId) {
- thing->setStateValue(boblightConnectedStateTypeId, bobClient->connected());
- break;
- }
- }
- }
-}
-
diff --git a/boblight/integrationpluginboblight.h b/boblight/integrationpluginboblight.h
deleted file mode 100644
index 2654cf5f..00000000
--- a/boblight/integrationpluginboblight.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-*
-* Copyright 2013 - 2020, nymea GmbH
-* Contact: contact@nymea.io
-*
-* This file is part of nymea.
-* This project including source code and documentation is protected by
-* copyright law, and remains the property of nymea GmbH. All rights, including
-* reproduction, publication, editing and translation, are reserved. The use of
-* this project is subject to the terms of a license agreement to be concluded
-* with nymea GmbH in accordance with the terms of use of nymea GmbH, available
-* under https://nymea.io/license
-*
-* GNU Lesser General Public License Usage
-* Alternatively, this project may be redistributed and/or modified under the
-* terms of the GNU Lesser General Public License as published by the Free
-* Software Foundation; version 3. This project 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 this project. If not, see .
-*
-* For any further details and any questions please contact us under
-* contact@nymea.io or see our FAQ/Licensing Information on
-* https://nymea.io/license/faq
-*
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-#ifndef INTEGRATIONPLUGINBOBLIGHT_H
-#define INTEGRATIONPLUGINBOBLIGHT_H
-
-#include "integrations/integrationplugin.h"
-#include "bobclient.h"
-
-class BobClient;
-class PluginTimer;
-
-class IntegrationPluginBoblight : public IntegrationPlugin
-{
- Q_OBJECT
-
- Q_PLUGIN_METADATA(IID "io.nymea.IntegrationPlugin" FILE "integrationpluginboblight.json")
- Q_INTERFACES(IntegrationPlugin)
-
-public:
- explicit IntegrationPluginBoblight();
-
- void init() override;
-
- void setupThing(ThingSetupInfo *info) override;
- void postSetupThing(Thing *thing) override;
- void thingRemoved(Thing *thing) override;
-
- void startMonitoringAutoThings() override;
-
- void executeAction(ThingActionInfo *info) override;
-
-private slots:
- void onConnectionChanged();
- void guhTimer();
-
- void onPowerChanged(int channel, bool power);
- void onBrightnessChanged(int channel, int brightness);
- void onColorChanged(int channel, const QColor &color);
- void onPriorityChanged(int priority);
-
-private:
- QColor tempToRgb(int temp);
-private:
- PluginTimer *m_pluginTimer = nullptr;
-
- QHash m_bobClients;
- bool m_canCreateAutoDevices = false;
-};
-
-#endif // INTEGRATIONPLUGINBOBLIGHT_H
diff --git a/boblight/integrationpluginboblight.json b/boblight/integrationpluginboblight.json
deleted file mode 100644
index 19dab5fa..00000000
--- a/boblight/integrationpluginboblight.json
+++ /dev/null
@@ -1,138 +0,0 @@
-{
- "id": "d5271bea-1362-4cc6-888f-2ebe80bad46a",
- "name": "Boblight",
- "displayName": "Boblight",
- "vendors": [
- {
- "id": "f0c9dd91-c2b0-4cd0-b161-a17fee9d2303",
- "name": "boblight",
- "displayName": "Boblight",
- "thingClasses": [
- {
- "id": "f267a7f4-ed75-4026-9b97-98884d7f4399",
- "name": "boblightServer",
- "displayName": "Boblight server",
- "createMethods": ["user"],
- "interfaces": ["gateway", "connectable"],
- "paramTypes": [
- {
- "id": "de82ea8c-2f1e-4b93-b85a-f6a0b7f87e4a",
- "name": "hostAddress",
- "displayName": "Host Address",
- "type" : "QString",
- "inputType": "IPv4Address",
- "defaultValue": "127.0.0.1"
- },
- {
- "id": "8cbe5ef8-6b45-441e-9051-08d48f3948da",
- "name": "port",
- "displayName": "Port",
- "type" : "int",
- "defaultValue": 19333
- },
- {
- "id": "277f2458-d932-4a6e-a7bb-58814ab99663",
- "name": "channels",
- "displayName": "Channels",
- "type": "int",
- "defaultValue": 1
- }
- ],
- "stateTypes": [
- {
- "id": "638fb9ec-4797-4ef6-a9b6-d935f1c49e17",
- "name": "connected",
- "displayName": "connected",
- "displayNameEvent": "Connected changed",
- "defaultValue": false,
- "type": "bool"
- },
- {
- "id": "60d345e8-757c-4bc2-a96b-31121fc84356",
- "name": "priority",
- "displayName": "Priority",
- "displayNameEvent": "Priority changed",
- "displayNameAction": "Set priority",
- "type": "int",
- "defaultValue": 128,
- "minValue": 0,
- "maxValue": 256,
- "writable": true
- }
-
- ]
- },
- {
- "id": "05347200-416e-4b75-b4e3-6f913a2a7e76",
- "name": "boblight",
- "displayName": "Boblight",
- "createMethods": ["auto"],
- "interfaces": ["colorlight", "connectable"],
- "paramTypes": [
- {
- "id": "7b5b784d-d623-4a2e-b081-9be84b1ce1a8",
- "name": "channel",
- "displayName": "Channel",
- "type": "int",
- "defaultValue": -1
- }
- ],
- "stateTypes": [
- {
- "id": "bb40f1bd-62b9-485e-86a1-b0c820a93b8a",
- "name": "connected",
- "displayName": "connected",
- "defaultValue": false,
- "displayNameEvent": "Connected changed",
- "type": "bool"
- },
- {
- "id": "95aec7b5-247a-42a2-8748-273b034b988c",
- "name": "power",
- "displayName": "Power",
- "defaultValue": false,
- "type": "bool",
- "displayNameEvent": "Power changed",
- "displayNameAction": "Set power",
- "writable": true
- },
- {
- "id": "0a92eab5-233c-4081-840b-15578091365c",
- "name": "brightness",
- "displayName": "Brightness",
- "defaultValue": 100,
- "type": "int",
- "displayNameEvent": "Brightness changed",
- "displayNameAction": "Set brightness",
- "writable": true,
- "minValue": 0,
- "maxValue": 100
- },
- {
- "id": "b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0",
- "name": "colorTemperature",
- "displayName": "Color Temperature",
- "defaultValue": 0,
- "type": "int",
- "displayNameEvent": "Color Temperature changed",
- "displayNameAction": "Set color temperature",
- "writable": true,
- "minValue": 0,
- "maxValue": 100
- },
- {
- "id": "a213d2d1-bd29-4a16-8459-520aa919ae67",
- "name": "color",
- "displayName": "Color",
- "defaultValue": "#ffffff",
- "type": "QColor",
- "displayNameEvent": "Color changed",
- "displayNameAction": "Set color",
- "writable": true
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/boblight/meta.json b/boblight/meta.json
deleted file mode 100644
index 1be06a36..00000000
--- a/boblight/meta.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "title": "Boblight",
- "tagline": "Connect to LED strips driven by Boblight.",
- "icon": "boblight.png",
- "stability": "community",
- "offline": true,
- "technologies": [
- "network"
- ],
- "categories": [
- "light"
- ]
-}
diff --git a/boblight/translations/d5271bea-1362-4cc6-888f-2ebe80bad46a-en_US.ts b/boblight/translations/d5271bea-1362-4cc6-888f-2ebe80bad46a-en_US.ts
deleted file mode 100644
index 4276d182..00000000
--- a/boblight/translations/d5271bea-1362-4cc6-888f-2ebe80bad46a-en_US.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
- Boblight
-
- Boblight
- The name of the ThingClass ({05347200-416e-4b75-b4e3-6f913a2a7e76})
-----------
-The name of the vendor ({f0c9dd91-c2b0-4cd0-b161-a17fee9d2303})
-----------
-The name of the plugin Boblight ({d5271bea-1362-4cc6-888f-2ebe80bad46a})
-
-
-
- Boblight server
- The name of the ThingClass ({f267a7f4-ed75-4026-9b97-98884d7f4399})
-
-
-
- Host Address
- The name of the ParamType (ThingClass: boblightServer, Type: thing, ID: {de82ea8c-2f1e-4b93-b85a-f6a0b7f87e4a})
-
-
-
- Port
- The name of the ParamType (ThingClass: boblightServer, Type: thing, ID: {8cbe5ef8-6b45-441e-9051-08d48f3948da})
-
-
-
- Channels
- The name of the ParamType (ThingClass: boblightServer, Type: thing, ID: {277f2458-d932-4a6e-a7bb-58814ab99663})
-
-
-
- Connected changed
- The name of the EventType ({bb40f1bd-62b9-485e-86a1-b0c820a93b8a}) of ThingClass boblight
-----------
-The name of the EventType ({638fb9ec-4797-4ef6-a9b6-d935f1c49e17}) of ThingClass boblightServer
-
-
-
- connected
- The name of the ParamType (ThingClass: boblight, EventType: connected, ID: {bb40f1bd-62b9-485e-86a1-b0c820a93b8a})
-----------
-The name of the StateType ({bb40f1bd-62b9-485e-86a1-b0c820a93b8a}) of ThingClass boblight
-----------
-The name of the ParamType (ThingClass: boblightServer, EventType: connected, ID: {638fb9ec-4797-4ef6-a9b6-d935f1c49e17})
-----------
-The name of the StateType ({638fb9ec-4797-4ef6-a9b6-d935f1c49e17}) of ThingClass boblightServer
-
-
-
- Priority changed
- The name of the EventType ({60d345e8-757c-4bc2-a96b-31121fc84356}) of ThingClass boblightServer
-
-
-
- Priority
- The name of the ParamType (ThingClass: boblightServer, ActionType: priority, ID: {60d345e8-757c-4bc2-a96b-31121fc84356})
-----------
-The name of the ParamType (ThingClass: boblightServer, EventType: priority, ID: {60d345e8-757c-4bc2-a96b-31121fc84356})
-----------
-The name of the StateType ({60d345e8-757c-4bc2-a96b-31121fc84356}) of ThingClass boblightServer
-
-
-
- Set priority
- The name of the ActionType ({60d345e8-757c-4bc2-a96b-31121fc84356}) of ThingClass boblightServer
-
-
-
- Channel
- The name of the ParamType (ThingClass: boblight, Type: thing, ID: {7b5b784d-d623-4a2e-b081-9be84b1ce1a8})
-
-
-
- Power changed
- The name of the EventType ({95aec7b5-247a-42a2-8748-273b034b988c}) of ThingClass boblight
-
-
-
- Power
- The name of the ParamType (ThingClass: boblight, ActionType: power, ID: {95aec7b5-247a-42a2-8748-273b034b988c})
-----------
-The name of the ParamType (ThingClass: boblight, EventType: power, ID: {95aec7b5-247a-42a2-8748-273b034b988c})
-----------
-The name of the StateType ({95aec7b5-247a-42a2-8748-273b034b988c}) of ThingClass boblight
-
-
-
- Set power
- The name of the ActionType ({95aec7b5-247a-42a2-8748-273b034b988c}) of ThingClass boblight
-
-
-
- Brightness changed
- The name of the EventType ({0a92eab5-233c-4081-840b-15578091365c}) of ThingClass boblight
-
-
-
- Brightness
- The name of the ParamType (ThingClass: boblight, ActionType: brightness, ID: {0a92eab5-233c-4081-840b-15578091365c})
-----------
-The name of the ParamType (ThingClass: boblight, EventType: brightness, ID: {0a92eab5-233c-4081-840b-15578091365c})
-----------
-The name of the StateType ({0a92eab5-233c-4081-840b-15578091365c}) of ThingClass boblight
-
-
-
- Set brightness
- The name of the ActionType ({0a92eab5-233c-4081-840b-15578091365c}) of ThingClass boblight
-
-
-
- Color Temperature changed
- The name of the EventType ({b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0}) of ThingClass boblight
-
-
-
- Color Temperature
- The name of the ParamType (ThingClass: boblight, ActionType: colorTemperature, ID: {b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0})
-----------
-The name of the ParamType (ThingClass: boblight, EventType: colorTemperature, ID: {b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0})
-----------
-The name of the StateType ({b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0}) of ThingClass boblight
-
-
-
- Set color temperature
- The name of the ActionType ({b6f24e6f-d2a8-4f22-b40f-3a0e38bdabe0}) of ThingClass boblight
-
-
-
- Color changed
- The name of the EventType ({a213d2d1-bd29-4a16-8459-520aa919ae67}) of ThingClass boblight
-
-
-
- Color
- The name of the ParamType (ThingClass: boblight, ActionType: color, ID: {a213d2d1-bd29-4a16-8459-520aa919ae67})
-----------
-The name of the ParamType (ThingClass: boblight, EventType: color, ID: {a213d2d1-bd29-4a16-8459-520aa919ae67})
-----------
-The name of the StateType ({a213d2d1-bd29-4a16-8459-520aa919ae67}) of ThingClass boblight
-
-
-
- Set color
- The name of the ActionType ({a213d2d1-bd29-4a16-8459-520aa919ae67}) of ThingClass boblight
-
-
-
-
diff --git a/debian/control b/debian/control
index 49ef4ffd..fb5d2c60 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,7 @@ Source: nymea-plugins
Section: utils
Priority: optional
Maintainer: Nymea GmbH
-Build-depends: libboblight-dev,
- debhelper (>= 0.0.0),
+Build-depends: debhelper (>= 0.0.0),
libnymea-dev (>= 0.26~),
libnymea-mqtt-dev,
libnymea-gpio-dev (>= 1.0.0~),
@@ -80,17 +79,6 @@ Description: nymea integration plugin for bluos
This package contains the nymea integration plugin for bluos based media devices
-Package: nymea-plugin-boblight
-Architecture: any
-Depends: ${shlibs:Depends},
- ${misc:Depends},
-Conflicts: nymea-plugins-translations (< 1.0.1)
-Description: nymea integration plugin for boblight
- This package contains the nymea integration plugin for boblight. Boblight allows
- controlling LEDs via home-brew controllers. See https://github.com/arvydas/boblight
- for informations on boblight.
-
-
Package: nymea-plugin-bose
Architecture: any
Depends: ${shlibs:Depends},
diff --git a/debian/nymea-plugin-boblight.install.in b/debian/nymea-plugin-boblight.install.in
deleted file mode 100644
index 2966e0f1..00000000
--- a/debian/nymea-plugin-boblight.install.in
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/libnymea_integrationpluginboblight.so
-boblight/translations/*qm usr/share/nymea/translations/
diff --git a/nymea-plugins.pro b/nymea-plugins.pro
index 6e9da803..1988023e 100644
--- a/nymea-plugins.pro
+++ b/nymea-plugins.pro
@@ -7,7 +7,6 @@ PLUGIN_DIRS = \
awattar \
bimmerconnected \
bluos \
- boblight \
bose \
bosswerk \
coinmarketcap \