Merge PR #515: Shelly: Add support for the shelly vintage bulb

This commit is contained in:
Jenkins nymea 2021-12-15 11:53:22 +01:00
commit a3a601b76d
3 changed files with 4 additions and 3 deletions

View File

@ -16,6 +16,7 @@ The currently supported devices are:
* Shelly H+T * Shelly H+T
* Shelly i3 * Shelly i3
* Shelly Motion * Shelly Motion
* Shelly Vintage
## Requirements ## Requirements
Shelly devices communicate with via MQTT. This means, in order to add Shelly devices to nymea, the nymea instance is required Shelly devices communicate with via MQTT. This means, in order to add Shelly devices to nymea, the nymea instance is required

View File

@ -458,7 +458,7 @@ void IntegrationPluginShelly::discoverThings(ThingDiscoveryInfo *info)
} else if (info->thingClassId() == shellyRgbw2ThingClassId) { } else if (info->thingClassId() == shellyRgbw2ThingClassId) {
namePattern = QRegExp("^shellyrgbw2-[0-9A-Z]+$"); namePattern = QRegExp("^shellyrgbw2-[0-9A-Z]+$");
} else if (info->thingClassId() == shellyDimmerThingClassId) { } else if (info->thingClassId() == shellyDimmerThingClassId) {
namePattern = QRegExp("^shellydimmer(2)?-[0-9A-Z]+$"); namePattern = QRegExp("^(shellydimmer(2)?|ShellyVintage)-[0-9A-Z]+$");
} else if (info->thingClassId() == shelly2ThingClassId) { } else if (info->thingClassId() == shelly2ThingClassId) {
namePattern = QRegExp("^shellyswitch-[0-9A-Z]+$"); namePattern = QRegExp("^shellyswitch-[0-9A-Z]+$");
} else if (info->thingClassId() == shelly25ThingClassId) { } else if (info->thingClassId() == shelly25ThingClassId) {
@ -1302,7 +1302,7 @@ void IntegrationPluginShelly::setupShellyGateway(ThingSetupInfo *info)
// Create 2 switches for some that have 2 // Create 2 switches for some that have 2
if (info->thing()->thingClassId() == shelly2ThingClassId if (info->thing()->thingClassId() == shelly2ThingClassId
|| info->thing()->thingClassId() == shelly25ThingClassId || info->thing()->thingClassId() == shelly25ThingClassId
|| info->thing()->thingClassId() == shellyDimmerThingClassId || (info->thing()->thingClassId() == shellyDimmerThingClassId && info->thing()->paramValue(shellyDimmerThingIdParamTypeId).toString().startsWith("shellydimmer")) // Don't create chids for shelly vintage
|| info->thing()->thingClassId() == shelly1lThingClassId) { || info->thing()->thingClassId() == shelly1lThingClassId) {
ThingDescriptor switchChild(shellySwitchThingClassId, info->thing()->name() + " switch 1", QString(), info->thing()->id()); ThingDescriptor switchChild(shellySwitchThingClassId, info->thing()->name() + " switch 1", QString(), info->thing()->id());
switchChild.setParams(ParamList() << Param(shellySwitchThingChannelParamTypeId, 1)); switchChild.setParams(ParamList() << Param(shellySwitchThingChannelParamTypeId, 1));

View File

@ -835,7 +835,7 @@
{ {
"id": "3a1d6fc1-c623-4b45-9c81-1573fcc15f99", "id": "3a1d6fc1-c623-4b45-9c81-1573fcc15f99",
"name": "shellyDimmer", "name": "shellyDimmer",
"displayName": "Shelly Dimmer / Dimmer 2", "displayName": "Shelly Dimmer (2) / Vintage",
"createMethods": ["discovery"], "createMethods": ["discovery"],
"interfaces": ["dimmablelight", "wirelessconnectable", "update"], "interfaces": ["dimmablelight", "wirelessconnectable", "update"],
"paramTypes": [ "paramTypes": [