Skip to content

Commit

Permalink
beta4; fix reset for +plug s; fix logic for additional sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
markirb committed Jun 14, 2024
1 parent 917b3d6 commit 8dd1ab3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Reverting to stock firmware is also possible [see here](https://github.com/mongo

## Supported devices and features

### Gen 3 Devices

Currently not supported.

### Plus devices

Expand Down Expand Up @@ -153,6 +156,7 @@ This firmware is free software and is distributed under [Apache 2.0 license](LIC
[+1]: https://www.shelly.cloud/en/products/shop/shelly-plus-1
[+1PM]: https://www.shelly.cloud/en/products/shop/shelly-plus-1-pm-2-pack/shelly-plus-1-pm
[+2PM]: https://www.shelly.cloud/en/products/shop/shelly-plus-2-pm
[+PlugS]: https://www.shelly.cloud/en/products/shop/shelly-plus-plug-s
[1L]: https://www.shelly.cloud/en/products/shop/shelly-1l
[Plug]: https://www.shelly.cloud/en/products/shop/1xplug
[PlugS]: https://www.shelly.cloud/en/products/shop/shelly-plug-s
Expand Down
5 changes: 4 additions & 1 deletion mos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
author: Shelly-HomeKit contributors
description: A HomeKit firmware for Shelly switches
version: 2.12.0-beta3
version: 2.12.0-beta4

libs_version: latest
modules_version: latest
Expand Down Expand Up @@ -772,6 +772,9 @@ conds:
- ["in2", "in", {title: "Input 2 settings"}]
- ["in2.ssw.name", "Shelly SSW2"]
- ["in2.sensor.name", "Shelly S2"]
- ["in3", "in", {title: "Input 3 settings"}]
- ["in3.ssw.name", "Shelly SSW3"]
- ["in3.sensor.name", "Shelly S3"]
- ["wc1", "wc", {title: "WC1 settings"}]
- ["wc1.name", "Window 1"]
- ["gdo1", "gdo", {title: "GDO1 settings"}]
Expand Down
3 changes: 2 additions & 1 deletion src/ShellyPlus1/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ void CreateComponents(std::vector<std::unique_ptr<Component>> *comps,

if (!sensors.empty()) {
CreateHAPSensors(&sensors, comps, accs, svr);
} else if (detatched_sensor) {
}
if (ext_sensor_switch && !gdo_mode) {
hap::CreateHAPInput(2, mgos_sys_config_get_in2(), comps, accs, svr);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/ShellyPlus1PM/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ void CreateComponents(std::vector<std::unique_ptr<Component>> *comps,

if (!sensors.empty()) {
CreateHAPSensors(&sensors, comps, accs, svr);
} else if (detatched_sensor) {
}
if (ext_sensor_switch && !gdo_mode) {
hap::CreateHAPInput(2, mgos_sys_config_get_in2(), comps, accs, svr);
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/ShellyPlus2PM/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ void CreateComponents(std::vector<std::unique_ptr<Component>> *comps,
return;
}

bool single_accessory = sensors.empty();
bool additional_input_digital = (FindInput(3) != nullptr);
bool single_accessory = sensors.empty() and !additional_input_digital;

if (mgos_sys_config_get_shelly_mode() == (int) Mode::kGarageDoor) {
hap::CreateHAPGDO(1, FindInput(1), FindInput(2), FindOutput(1),
Expand All @@ -260,6 +261,9 @@ void CreateComponents(std::vector<std::unique_ptr<Component>> *comps,
if (!sensors.empty()) {
CreateHAPSensors(&sensors, comps, accs, svr);
}
if (additional_input_digital) {
hap::CreateHAPInput(3, mgos_sys_config_get_in3(), comps, accs, svr);
}
}

} // namespace shelly

0 comments on commit 8dd1ab3

Please sign in to comment.