Skip to content

Commit 068e18c

Browse files
committed
Merge branch 'master' into improve-pm
2 parents 12b8d40 + f6ac761 commit 068e18c

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

fs_src/script.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,19 @@ function updateComponent(cd) {
726726
if (cd.type == Component_Type.kLightBulb) {
727727
if (cd.bulb_type == LightBulbController_BulbType.kCCT) {
728728
headText = "CCT";
729+
if (lastInfo.model == "ShellyRGBW2") {
730+
if (cd.id == 1) {
731+
headText += " R/G";
732+
} else {
733+
headText += " B/W";
734+
}
735+
}
729736
} else if (cd.bulb_type == LightBulbController_BulbType.kRGBW) {
730-
headText = "RGB";
737+
if (lastInfo.sys_mode == 4) {
738+
headText = "RGBW";
739+
} else {
740+
headText = "RGB";
741+
}
731742
} else {
732743
headText = "Light";
733744
}

src/shelly_switch.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ void ShellySwitch::AddPowerMeter(uint16_t *iid) {
370370
// Power
371371
power_char_ = new mgos::hap::FloatCharacteristic(
372372
(*iid)++, &kHAPCharacteristic_EveConsumption, 0.0f, 65535.0f, 0.1f,
373-
[this](HAPAccessoryServerRef *,
374-
const HAPFloatCharacteristicReadRequest *, float *value) {
373+
[this](HAPAccessoryServerRef *, const HAPFloatCharacteristicReadRequest *,
374+
float *value) {
375375
auto power = out_pm_->GetPowerW();
376376
if (!power.ok()) return kHAPError_Busy;
377377
*value = power.ValueOrDie();
@@ -382,8 +382,8 @@ void ShellySwitch::AddPowerMeter(uint16_t *iid) {
382382
// Energy
383383
total_power_char_ = new mgos::hap::FloatCharacteristic(
384384
(*iid)++, &kHAPCharacteristic_EveTotalConsumption, 0.0f, 65535.0f, 0.1f,
385-
[this](HAPAccessoryServerRef *,
386-
const HAPFloatCharacteristicReadRequest *, float *value) {
385+
[this](HAPAccessoryServerRef *, const HAPFloatCharacteristicReadRequest *,
386+
float *value) {
387387
auto energy = out_pm_->GetEnergyWH();
388388
if (!energy.ok()) return kHAPError_Busy;
389389
*value = energy.ValueOrDie();

0 commit comments

Comments
 (0)