/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2019 Bernhard Trinnes . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DEVICEPLUGINSONOS_H
#define DEVICEPLUGINSONOS_H
#include "devices/deviceplugin.h"
#include "plugintimer.h"
#include "sonos.h"
#include
#include
class DevicePluginSonos : public DevicePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginsonos.json")
Q_INTERFACES(DevicePlugin)
public:
explicit DevicePluginSonos();
~DevicePluginSonos() override;
Device::DeviceSetupStatus setupDevice(Device *device) override;
DevicePairingInfo pairDevice(DevicePairingInfo &devicePairingInfo) override;
DevicePairingInfo confirmPairing(DevicePairingInfo &devicePairingInfo, const QString &username, const QString &secret) override;
void postSetupDevice(Device *device) override;
void startMonitoringAutoDevices() override;
void deviceRemoved(Device *device) override;
Device::DeviceError executeAction(Device *device, const Action &action) override;
private:
PluginTimer *m_pluginTimer = nullptr;
QHash m_sonosConnections;
private slots:
void onPluginTimer();
void onConnectionChanged();
};
#endif // DEVICEPLUGINSONOS_H