Skip to content

Commit

Permalink
new pinning
Browse files Browse the repository at this point in the history
  • Loading branch information
markirb committed Aug 28, 2024
1 parent e0cf515 commit 08db16d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MAKEFLAGS += --warn-undefined-variables --no-builtin-rules

.PHONY: build check-format format release upload \
Shelly1 Shelly1L Shelly1PM Shelly25 Shelly2 ShellyColorBulb ShellyDuo ShellyI3 ShellyPlug ShellyPlugS ShellyPlusPlugS ShellyPlus1 ShellyPlus1PM ShellyPlus2PM ShellyPlusI4 ShellyRGBW2 ShellyVintage ShellyU ShellyU25 ShellyUDuo ShellyURGBW2 ShellyUNI
Shelly1 Shelly1L Shelly1PM Shelly25 Shelly2 ShellyColorBulb ShellyDuo ShellyI3 ShellyPlug ShellyPlugS ShellyPlusPlugS ShellyPlus1 ShellyPlus1PM ShellyPlus2PM ShellyPlusI4 ShellyRGBW2 ShellyVintage ShellyU ShellyU25 ShellyUDuo ShellyURGBW2 ShellyUNI ShellyPlusRGBWPM
.SUFFIXES:

MOS ?= mos
Expand All @@ -27,7 +27,7 @@ ifneq "$(VERBOSE)$(V)" "00"
MOS_BUILD_FLAGS_FINAL += --verbose
endif

build: Shelly1 Shelly1L Shelly1PM Shelly25 Shelly2 ShellyColorBulb ShellyDuo ShellyI3 ShellyPlug ShellyPlugS ShellyPlusPlugS ShellyPlus1 ShellyPlus1PM ShellyPlus2PM ShellyPlusI4 ShellyRGBW2 ShellyVintage ShellyU ShellyU25 ShellyURGBW2 ShellyUNI
build: Shelly1 Shelly1L Shelly1PM Shelly25 Shelly2 ShellyColorBulb ShellyDuo ShellyI3 ShellyPlug ShellyPlugS ShellyPlusPlugS ShellyPlus1 ShellyPlus1PM ShellyPlus2PM ShellyPlusI4 ShellyRGBW2 ShellyVintage ShellyU ShellyU25 ShellyURGBW2 ShellyUNI ShellyPlusRGBWPM

release:
$(MAKE) build CLEAN=1 RELEASE=1
Expand Down
5 changes: 3 additions & 2 deletions fs_src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,8 @@ function updateComponent(cd) {
if (cd.type == Component_Type.kLightBulb) {
if (cd.bulb_type == LightBulbController_BulbType.kCCT) {
headText = "CCT";
if (lastInfo.model == "ShellyRGBW2") {
if (lastInfo.model == "ShellyRGBW2" ||
lastInfo.model == "ShellyPlusRGBWPM") {
if (cd.id == 1) {
headText += " R/G";
} else {
Expand Down Expand Up @@ -937,7 +938,7 @@ function updateElement(key, value, info) {
updateInnerText(el("uptime"), durationStr(value));
break;
case "model":
if (value.endsWith("RGBW2")) {
if (value.endsWith("RGBW2") || value.endsWith("RGBWPM")) {
el("sys_mode_container").style.display = "block";
if (el("sys_mode_0")) el("sys_mode_0").remove();
} else {
Expand Down
6 changes: 3 additions & 3 deletions mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,14 @@ conds:
CONFIG_FREERTOS_UNICORE=y
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
cdefs:
LED_GPIO: 0
LED_GPIO: 14
LED_ON: 0
BTN_GPIO: 0
BTN_GPIO: 22
BTN_DOWN: 0
GPIO_R: 25
GPIO_G: 26
GPIO_B: 27
GPIO_W: 24
GPIO_W: 4
GPIO_I1: 36
GPIO_I2: 37
GPIO_I3: 38
Expand Down
22 changes: 19 additions & 3 deletions src/ShellyRGBW2/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,26 @@ void CreatePeripherals(std::vector<std::unique_ptr<Input>> *inputs,
in->Init();
inputs->emplace_back(in);

// TODO: add more inputs for +RGBWPM
// TODO: add more inputs for +RGBWPM
#ifdef GPIO_I2
in = new InputPin(2, GPIO_I2, 1, MGOS_GPIO_PULL_NONE, true);
in->AddHandler(std::bind(&HandleInputResetSequence, in, 0, _1, _2));
in->Init();
inputs->emplace_back(in);

in = new InputPin(3, GPIO_I3, 1, MGOS_GPIO_PULL_NONE, true);
in->AddHandler(std::bind(&HandleInputResetSequence, in, 0, _1, _2));
in->Init();
inputs->emplace_back(in);

in = new InputPin(4, GPIO_I4, 1, MGOS_GPIO_PULL_NONE, true);
in->AddHandler(std::bind(&HandleInputResetSequence, in, 0, _1, _2));
in->Init();
inputs->emplace_back(in);
#endif

// InitSysLED(LED_GPIO, LED_ON);
// InitSysBtn(BTN_GPIO, BTN_DOWN);
InitSysLED(LED_GPIO, LED_ON);
InitSysBtn(BTN_GPIO, BTN_DOWN);
}

void CreateComponents(std::vector<std::unique_ptr<Component>> *comps,
Expand Down

0 comments on commit 08db16d

Please sign in to comment.