Merge branch 'development' into prerelease-14.3.0

This commit is contained in:
Theo Arends 2024-10-10 12:40:29 +02:00
commit 96a99f9951
962 changed files with 129016 additions and 30496 deletions

View File

@ -6,8 +6,8 @@
- [ ] The pull request is done against the latest development branch - [ ] The pull request is done against the latest development branch
- [ ] Only relevant files were touched - [ ] Only relevant files were touched
- [ ] Only one feature/fix was added per PR and the code change compiles without warnings - [ ] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.7 - [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
- [ ] The code change is tested and works with Tasmota core ESP32 V.3.0.4 - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.0.240926
- [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla). - [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla).
_NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_ _NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_

8
.gitignore vendored
View File

@ -8,13 +8,17 @@
*.o *.o
*.gcno *.gcno
*.gcda *.gcda
dependencies.lock
## Project files ###### ## Project files ######
managed_components
.platformio .platformio
.pio .pio
.clang_complete .clang_complete
.gcc-flags.json .gcc-flags.json
.cache .cache
.dummy
sdkconfig.*
data data
unpacked_fs unpacked_fs
unpacked_boards unpacked_boards
@ -42,3 +46,7 @@ lib/libesp32/berry/berry
.vscode/extensions.json .vscode/extensions.json
*.bak *.bak
*.code-workspace *.code-workspace
## Python virtual environments for Platformio ##
venv
.venv

View File

@ -104,10 +104,15 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| | | | | | | | | | | | | | | |
| **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** | | **Feature or Sensor** | **l** | **t** | **k** | **s** | **i** | **d** | **Remarks** |
| USE_I2C | - | x / x | x | x | - | x | | USE_I2C | - | x / x | x | x | - | x |
| USE_RTC_CHIPS | - | - / x | - | - | - | - |
| -USE_DS3231 | - | - / - | - | - | - | - |
| -USE_BM8563 | - | - / x | - | - | - | - |
| -USE_PCF85363 | - | - / - | - | - | - | - |
| -USE_RX8010 | - | - / - | - | - | - | - |
| USE_SHT | - | - / x | - | x | - | - | | USE_SHT | - | - / x | - | x | - | - |
| USE_HTU | - | - / x | - | x | - | - | | USE_HTU | - | - / x | - | x | - | - |
| USE_BMP | - | - / x | - | x | - | - | | USE_BMP | - | - / x | - | x | - | - |
| USE_BME68X | - | - / x | - | x | - | - | | -USE_BME68X | - | - / x | - | x | - | - |
| USE_AMSX915 | - | - / - | - | - | - | - | | USE_AMSX915 | - | - / - | - | - | - | - |
| USE_SPL06_007 | - | - / - | - | - | - | - | | USE_SPL06_007 | - | - / - | - | - | - | - |
| USE_QMP6988 | - | - / - | - | - | - | - | | USE_QMP6988 | - | - / - | - | - | - | - |
@ -139,7 +144,6 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| USE_ENS16x | - | - / - | - | - | - | - | | USE_ENS16x | - | - / - | - | - | - | - |
| USE_ENS210 | - | - / - | - | - | - | - | | USE_ENS210 | - | - / - | - | - | - | - |
| USE_MPU6050 | - | - / - | - | - | - | - | | USE_MPU6050 | - | - / - | - | - | - | - |
| USE_DS3231 | - | - / - | - | - | - | - |
| USE_MGC3130 | - | - / - | - | - | - | - | | USE_MGC3130 | - | - / - | - | - | - | - |
| USE_MAX44009 | - | - / - | - | - | - | - | | USE_MAX44009 | - | - / - | - | - | - | - |
| USE_SCD30 | - | - / x | - | x | - | - | | USE_SCD30 | - | - / x | - | x | - | - |
@ -187,12 +191,10 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the
| USE_EZORTD | - | - / - | - | - | - | - | | USE_EZORTD | - | - / - | - | - | - | - |
| USE_SEESAW_SOIL | - | - / - | - | - | - | - | | USE_SEESAW_SOIL | - | - / - | - | - | - | - |
| USE_TOF10120 | - | - / - | - | - | - | - | | USE_TOF10120 | - | - / - | - | - | - | - |
| USE_BM8563 | - | - / - | - | - | - | - |
| USE_AM2320 | - | - / - | - | - | - | - | | USE_AM2320 | - | - / - | - | - | - | - |
| USE_T67XX | - | - / - | - | - | - | - | | USE_T67XX | - | - / - | - | - | - | - |
| USE_HM330X | - | - / - | - | - | - | - | | USE_HM330X | - | - / - | - | - | - | - |
| USE_HDC2010 | - | - / - | - | - | - | - | | USE_HDC2010 | - | - / - | - | - | - | - |
| USE_PCF85363 | - | - / - | - | - | - | - |
| USE_DS3502 | - | - / - | - | - | - | - | | USE_DS3502 | - | - / - | - | - | - | - |
| USE_HYT | - | - / - | - | - | - | - | | USE_HYT | - | - / - | - | - | - | - |
| USE_LUXV30B | - | - / - | - | - | - | - | | USE_LUXV30B | - | - / - | - | - | - | - |

View File

@ -6,6 +6,132 @@ All notable changes to this project will be documented in this file.
## [14.2.0] 20240814 ## [14.2.0] 20240814
- Release Rita - Release Rita
## [14.2.0.6]
### Added
- Support for Sonoff SPM v1.3.0 (#13447)
- LVGL port `colorwheel` from LVGL 8 (#22244)
- HASPmota `cpicker` and `msgbox` (#22244)
- Support for DALI 1 on ESP8266
### Breaking Changed
### Changed
- ESP32 platform update from 2024.09.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.5 to v3.1.0.240926 (#22203)
- Berry improve `persist` dirty data handling (#22246)
- HASPmota `delete` instead of `delete()` (#22245)
### Fixed
- ESP32 Range Extender compile error with core 3.0.0 (#22205)
- HASPmota error when page '1' is not defined (#22220)
- ESP32-S3 uDisplay force cache writes to RGB display (#22222)
- ESP32 Dali compile error with core 3.x (#22214)
- Dali received data decoding
- ESP32 Ethernet using EthClockMode 3 (#22248)
### Removed
## [14.2.0.5] 20240926
### Added
- ESP8266 support for I2C CLK on GPIO16 (#22199)
- ESP8266 support for one-wire M1601 temperature sensor on DS18x20 GPIO (#21376)
- Support for BL0906 up to 6 channel energy monitor as used in Athom EM2/EM6 (#22167)
### Changed
- ESP8266 platform update from 2024.06.00 to 2024.09.00 and Framework (Arduino Core) from v2.7.7 to v2.7.8 (#22199)
### Fixed
- HASPmota broken `changed` event (#22194)
## [14.2.0.4] 20240924
### Added
- HX711 optional calibration precision option on command ``Sensor34 2 <weight in gram> <precision>`` where `<precision>` is 1 to 20 (#13983)
- Matter support for Zigbee Occupancy and Light 0/1/2 (OnOff / Dimmer / White Color Temperature) (#22110)
- KNX additional KnxTx functions and define KNX_USE_DPT9 (#22071)
- Support for I2C M5Unit (Mini)Scales using HX711 driver
- Berry virtual Energy driver (#22134)
- Support for RX8010 RTC as used in IOTTIMER (#21376)
- ESP8266 experimental support for second I2C bus
- Berry improve `int64` constructor (#22172)
- MQTT warning if trying to connect without TLS on a port that normally uses TLS (#22175)
### Changed
- Refactored I2C drivers HTU21, BH1750, SHT3x, iAQ and HYT
- Add command entered to command error and command unknown message
- ESP32 platform update from 2024.08.11 to 2024.09.10 and Framework (Arduino Core) from v3.0.4 to v3.0.5 (#22163)
- SCD30 Lowered I2C clock from 100k to 50k (#15438)
- Refactor and fix PID sensor (PID_USE_LOCAL_SENSOR) read race condition (#22162)
### Fixed
- Shutter missing HOLD on shutterbutton (#22108)
- ModbusBridge request and response logic (#22075)
- Berry energy missing attributes (#22116)
- Zigbee flashing CC2562P with latest firmware (#22117)
- SML trx pin error (#22119)
- Shutter remaining issues on shutterinvert (#22120)
- Berry I2C to prepare M5Stack I2C STM32 based devices (#22143)
- Autoconf prevent 'init.bat' from stopping on empty lines (#22158)
- Compilation exception when metrics not found (#22170)
- ESP8266 Exception 3 on tasmota-minimal caused by unaligned PROGMEM (#22169)
- LVGL compilation of lv_menu (#22188)
## [14.2.0.3] 20240908
### Added
- Command ``SetOption69 1`` to enable Serial Bridge inverted Receive (#22000)
- Support nexus protocol and calculation of separation limit to rc-switch library (#21886)
- Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro (#22076)
- Berry Zigbee improvements to prepare Matter (#22083)
- Matter support for Zigbee Temperature, Humidity and Pressure sensors (#22084)
- SML multi TRX line (#22056)
### Breaking Changed
- Berry make `energy` modules changes from #21887 backwards compatible (#22046)
### Changed
- ESP32 platform update from 2024.08.10 to 2024.08.11 (#22021)
- ESP32 LVGL library from v9.1.0 to v9.2.0 (#22031)
### Fixed
- Matter fixed UI bug when no endpoints configured (#22008)
- Zigbee extend timeout for MCU reboot from 5s to 10s (#22009)
- Matter fix when Rules are disabled (#22016)
- BearSSL panic on ESP8266 in rare conditions (#22017)
- Crash when calling TasmotaSerial destructor when initialized with incorrect arguments (#22036)
- LVGL Added OpenHASP icons to font `montserrat-28` (#22048)
- Matter fail to report Shutter status if no shutter is configured in Tasmota (#22049)
- Matter fix Waterleak broken after Berry solidification optimisation #21885 (#22052)
- Berry avoid `readbytes()` from crashing when file is too large (#22057)
- Zigbee avoid disabling console serial on ESP32 and improved log messages (#22082)
### Removed
- Berry remove reuse of methods for interface-like code reuse #21500 (#22055)
## [14.2.0.2] 20240823
### Changed
- Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere
- GPIOViewer from v1.5.5 to v1.5.6
## [14.2.0.1] 20240821
### Added
- Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration (#20653)
- Energy command ``PowerSet 60,230`` to calibrate both Current and Power with known resistive load of 60W at 230V using calibrated Voltage
- Energy command ``CurrentSet 60,230`` to calibrate both Power and Current with known resistive load of 60W at 230V using calibrated Voltage
### Changed
- Energy force Apparent Power equals Active Power when (Calculated) Apparent Power is less than Active Power (#20653)
### Fixed
- Shutter timing registers overflow (#21966)
- PZEM continue energy monitoring when one phase fails (#21968)
- Energy calculation (#20653)
### Removed
- ESP8266 Analog input support using energy driver as only one channel is available
## [Released]
## [14.2.0] 20240814
- Release Rita
## [14.1.0.4] 20240814 ## [14.1.0.4] 20240814
### Added ### Added
- Support for Sonoff iFan04-H using template (#16402) - Support for Sonoff iFan04-H using template (#16402)
@ -70,12 +196,13 @@ All notable changes to this project will be documented in this file.
- ESP32 platform update from 2024.06.11 to 2024.07.10 (#21745) - ESP32 platform update from 2024.06.11 to 2024.07.10 (#21745)
- ESP32 platform update from 2024.07.10 to 2024.07.11 (#21765) - ESP32 platform update from 2024.07.10 to 2024.07.11 (#21765)
- Berry simplified `module persist` (#21812) - Berry simplified `module persist` (#21812)
- GPIOViewer from v1.5.4 to v1.5.5 (No functional change)
### Fixed ### Fixed
- Berry `bytes.resize()` for large sizes (#21716) - Berry `bytes.resize()` for large sizes (#21716)
- On universal display remove default backlight power if a single PWM channel is used for backlight. Regression from 14.0.0.1 (#21726) - On universal display remove default backlight power if a single PWM channel is used for backlight. Regression from 14.0.0.1 (#21726)
- ESP32 I2S fixes (#21770) - ESP32 I2S fixes (#21770)
- ESP32 Resistive Touch xpt for 2 spi busses (#21814) - ESP32 Resistive Touch xpt for 2 spi buses (#21814)
## [14.1.0.2] 20240627 ## [14.1.0.2] 20240627
### Added ### Added
@ -253,8 +380,8 @@ All notable changes to this project will be documented in this file.
- Neopool prevent possible multiple bus requests (#21267) - Neopool prevent possible multiple bus requests (#21267)
- Berry `web_add_handler` called before `Webserver` is initialized (#21272) - Berry `web_add_handler` called before `Webserver` is initialized (#21272)
- Put back wifi IPv6 workaround (#21274) - Put back wifi IPv6 workaround (#21274)
- Async HMDI CEC (#21287) - Async HDMI CEC (#21287)
- Berry `math.inf`, `math.isinf()` and fixed json ouput for `inf` and `nan` (#21304) - Berry `math.inf`, `math.isinf()` and fixed json output for `inf` and `nan` (#21304)
- Compilation of Ethernet when SPI drivers are disabled (#21321) - Compilation of Ethernet when SPI drivers are disabled (#21321)
- Conflicting log_level definitions in NimBLE (#21337) - Conflicting log_level definitions in NimBLE (#21337)
- Avoid unwanted OTA upgrade when safeboot starts for the first time (#21360) - Avoid unwanted OTA upgrade when safeboot starts for the first time (#21360)
@ -488,7 +615,7 @@ All notable changes to this project will be documented in this file.
- Web file upload response on upload error (#20340) - Web file upload response on upload error (#20340)
- ESP32 shutter exception 6 (divide by zero) on ``ShutterMode 4`` (#20524) - ESP32 shutter exception 6 (divide by zero) on ``ShutterMode 4`` (#20524)
- GPIOViewer exception 3 - GPIOViewer exception 3
- Berry assigment to list with negative index (#20537) - Berry assignment to list with negative index (#20537)
- Matter support for Alexa (#20545) - Matter support for Alexa (#20545)
- ESP8266 IPv6 support (#20539) - ESP8266 IPv6 support (#20539)
- ESP32 Audio for Core3, MP3Stream and Shine (#20540) - ESP32 Audio for Core3, MP3Stream and Shine (#20540)
@ -871,7 +998,7 @@ All notable changes to this project will be documented in this file.
- Shutter bootloop using more than 4 shutters (#18673) - Shutter bootloop using more than 4 shutters (#18673)
- AIThinker webcam issues (#18652) - AIThinker webcam issues (#18652)
- Berry `tasmota.wifi()` would wrongly report wifi as up - Berry `tasmota.wifi()` would wrongly report wifi as up
- Inverted shutter now reflect status also in WEBGUI and several minor fixes to make "inverted" consistant (#18701) - Inverted shutter now reflect status also in WEBGUI and several minor fixes to make "inverted" consistent (#18701)
- Matter fix fabric provisioning from CASE session for iOS 16.5 (#18709) - Matter fix fabric provisioning from CASE session for iOS 16.5 (#18709)
- ESP32 SPI initialization for MFRC522 (#18711) - ESP32 SPI initialization for MFRC522 (#18711)
- Freeze BMP readings before deepsleep (#18720) - Freeze BMP readings before deepsleep (#18720)
@ -891,7 +1018,7 @@ All notable changes to this project will be documented in this file.
- Support for PCA9557 8-bit I/O expander (#18632) - Support for PCA9557 8-bit I/O expander (#18632)
- Matter support for async HTTP for bridged devices (#18656) - Matter support for async HTTP for bridged devices (#18656)
- Zigbee support for air sensors (#18665) - Zigbee support for air sensors (#18665)
- Command ``I2cScan0`` to scan both busses on ESP32 with one command - Command ``I2cScan0`` to scan both buses on ESP32 with one command
### Breaking Changed ### Breaking Changed
- Change command ``FileUpload`` index binary data detection from >199 to >299 - Change command ``FileUpload`` index binary data detection from >199 to >299
@ -1007,7 +1134,7 @@ All notable changes to this project will be documented in this file.
### Changed ### Changed
- ADC Range oversample from 2 to 32 (#17975) - ADC Range oversample from 2 to 32 (#17975)
- ESP32 Framework (Core) from v2.0.6 to v2.0.7 - ESP32 Framework (Core) from v2.0.6 to v2.0.7
- Move #define OTA_URL from user_config.h to board files for better inital support (#18008) - Move #define OTA_URL from user_config.h to board files for better initial support (#18008)
- Increase number of (virtual)relays and (virtual)buttons to 32 - Increase number of (virtual)relays and (virtual)buttons to 32
- LibTeleinfo from v1.1.3 to v1.1.5 (#18050) - LibTeleinfo from v1.1.3 to v1.1.5 (#18050)
@ -1074,7 +1201,7 @@ All notable changes to this project will be documented in this file.
- Support for PCA9632 4-channel 8-bit PWM driver as light driver by Pascal Heinrich (#17557) - Support for PCA9632 4-channel 8-bit PWM driver as light driver by Pascal Heinrich (#17557)
- Berry `bytes()` now evaluates to `false` if empty - Berry `bytes()` now evaluates to `false` if empty
- Berry ``crypto.AES_CCM`` (required by Matter protocol) - Berry ``crypto.AES_CCM`` (required by Matter protocol)
- ESP32 support for BMPxxx sensors on two I2C busses (#17643) - ESP32 support for BMPxxx sensors on two I2C buses (#17643)
- Berry add implicit ``_class`` parameter to static methods - Berry add implicit ``_class`` parameter to static methods
### Changed ### Changed
@ -1386,9 +1513,9 @@ All notable changes to this project will be documented in this file.
## [12.0.2.2] 20220701 ## [12.0.2.2] 20220701
### Added ### Added
- Command ``GlobalTemp2 1..250`` to select Global Temperature source indexed from teleperiod occurance data (#15834) - Command ``GlobalTemp2 1..250`` to select Global Temperature source indexed from teleperiod occurrence data (#15834)
- Command ``GlobalHum2 1..250`` to select Global Humidity source indexed from teleperiod occurance data (#15834) - Command ``GlobalHum2 1..250`` to select Global Humidity source indexed from teleperiod occurrence data (#15834)
- Command ``GlobalPress2 1..250`` to select Global Pressure source indexed from teleperiod occurance data (#15834) - Command ``GlobalPress2 1..250`` to select Global Pressure source indexed from teleperiod occurrence data (#15834)
## [12.0.2.1] 20220622 ## [12.0.2.1] 20220622
### Added ### Added
@ -1459,7 +1586,7 @@ All notable changes to this project will be documented in this file.
- Command ``EnergyExportActive<phase>`` to (p)reset energy export active for supported devices. Currently ADE7880 only (#13515) - Command ``EnergyExportActive<phase>`` to (p)reset energy export active for supported devices. Currently ADE7880 only (#13515)
- Sonoff SPM delayed SetPowerOnState (#13447) - Sonoff SPM delayed SetPowerOnState (#13447)
- Command ``SetOption139 0/1`` to switch between pressure unit "mmHg" (0) or "inHg" (1) when ``SO24 1`` (#15350) - Command ``SetOption139 0/1`` to switch between pressure unit "mmHg" (0) or "inHg" (1) when ``SO24 1`` (#15350)
- Support for flowrate meters like YF-DN50 and similary (#15474) - Support for flowrate meters like YF-DN50 and similar (#15474)
- Command ``IfxRp ""|<policy>`` adds optional InfluxDb Retention Policy (#15513) - Command ``IfxRp ""|<policy>`` adds optional InfluxDb Retention Policy (#15513)
- Command ``SetOption140 0/1`` to switch between MQTT Clean Session (0) or Persistent Session (1) (#15530) - Command ``SetOption140 0/1`` to switch between MQTT Clean Session (0) or Persistent Session (1) (#15530)
@ -1716,7 +1843,7 @@ All notable changes to this project will be documented in this file.
### Changed ### Changed
- (Internal) Range conversion edge values - (Internal) Range conversion edge values
- NimBLE to v.1.3.3 - NimBLE to v.1.3.3
- MQTT TLS dual mode (CA or fingeprint) in same firmware, ``SetOption132 1`` to force fingerprint - MQTT TLS dual mode (CA or fingerprint) in same firmware, ``SetOption132 1`` to force fingerprint
- Toolchains for ESP32x changed from 8.4.0-2021r1 to 8.4.0-2021r2 - Toolchains for ESP32x changed from 8.4.0-2021r1 to 8.4.0-2021r2
### Fixed ### Fixed
@ -1731,7 +1858,7 @@ All notable changes to this project will be documented in this file.
- ESP32 fix leftover GPIO configuration after restart - ESP32 fix leftover GPIO configuration after restart
- ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) (#13447) - ESP32 Proof of Concept Sonoff SPM with limited functionality (switching and energy monitoring) (#13447)
- WS2812 scheme 13 stairs effect (#13595) - WS2812 scheme 13 stairs effect (#13595)
- ESP32 Preliminary support for Tasmota Apps (.tapp extesions) - ESP32 Preliminary support for Tasmota Apps (.tapp extensions)
- ESP32 Berry support for neopixel (WS2812, SK6812) - ESP32 Berry support for neopixel (WS2812, SK6812)
- Command ``IfxPeriod `` to overrule ``Teleperiod`` for Influx messages (#13750) - Command ``IfxPeriod `` to overrule ``Teleperiod`` for Influx messages (#13750)
- ESP32 OTA over HTTPS - ESP32 OTA over HTTPS
@ -1740,7 +1867,7 @@ All notable changes to this project will be documented in this file.
### Changed ### Changed
- ESP8266 Gratuitous ARP enabled and set to 60 seconds (#13623) - ESP8266 Gratuitous ARP enabled and set to 60 seconds (#13623)
- Removed ILI9488 driver in favor of Unversal Display Driver - Removed ILI9488 driver in favor of Universal Display Driver
- IRremoteESP8266 library from v2.7.20 to v2.8.0 (#13738) - IRremoteESP8266 library from v2.7.20 to v2.8.0 (#13738)
- Ethernet hostname ending in ``_eth`` to ``-eth`` according to RFC952 - Ethernet hostname ending in ``_eth`` to ``-eth`` according to RFC952
- ESP32 core library from v2.0.1 to v2.0.1.1 (#13768) - ESP32 core library from v2.0.1 to v2.0.1.1 (#13768)
@ -1861,7 +1988,7 @@ All notable changes to this project will be documented in this file.
## [9.5.0.6] 20210820 ## [9.5.0.6] 20210820
### Added ### Added
- Version bump to monitor possible HTTP issues releated to ``SetOption128`` - Version bump to monitor possible HTTP issues related to ``SetOption128``
### Changed ### Changed
- Berry now compiling in ``strict`` mode to catch more bugs - Berry now compiling in ``strict`` mode to catch more bugs
@ -2516,7 +2643,7 @@ All notable changes to this project will be documented in this file.
- Exception 28 due to device group buffer overflow (#9459) - Exception 28 due to device group buffer overflow (#9459)
- Shutter timing problem due to buffer overflow in calibration matrix (#9458) - Shutter timing problem due to buffer overflow in calibration matrix (#9458)
- Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466) - Light wakeup exception 0 (divide by zero) when ``WakeupDuration`` is not initialised (#9466)
- ADC initalization sequence (#9473) - ADC initialization sequence (#9473)
- Thermostat sensor status corruption regression from v8.5.0.1 (#9449) - Thermostat sensor status corruption regression from v8.5.0.1 (#9449)
### Removed ### Removed
@ -2610,7 +2737,7 @@ All notable changes to this project will be documented in this file.
- Command ``DzSend<type> <index>,<value1(;value2)|state>`` to send values or state to Domoticz - Command ``DzSend<type> <index>,<value1(;value2)|state>`` to send values or state to Domoticz
- Command ``SetOption100 0/1`` to remove Zigbee ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message - Command ``SetOption100 0/1`` to remove Zigbee ``ZbReceived`` value from ``{"ZbReceived":{xxx:yyy}}`` JSON message
- Command ``SetOption101 0/1`` to add the Zigbee source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3 - Command ``SetOption101 0/1`` to add the Zigbee source endpoint as suffix to attributes, ex `Power3` instead of `Power` if sent from endpoint 3
- Command (``S``)``SerialSend6`` \<comma seperated values\> (#8937) - Command (``S``)``SerialSend6`` \<comma separated values\> (#8937)
- Support for Sonoff Zigbee Bridge as module 75 (#8583) - Support for Sonoff Zigbee Bridge as module 75 (#8583)
### Changed ### Changed
@ -2629,7 +2756,7 @@ All notable changes to this project will be documented in this file.
- Command ``SetOption97 0/1`` to switch between Tuya serial speeds 9600 bps (0) or 115200 bps (1) - Command ``SetOption97 0/1`` to switch between Tuya serial speeds 9600 bps (0) or 115200 bps (1)
- Command ``SetOption98 0/1`` to provide rotary rule triggers (1) instead of controlling light (0) - Command ``SetOption98 0/1`` to provide rotary rule triggers (1) instead of controlling light (0)
- Command ``SetOption99 0/1`` to enable zero cross detection on PWM dimmer - Command ``SetOption99 0/1`` to enable zero cross detection on PWM dimmer
- Support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adaptater. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff - Support for Energy sensor (Denky) for French Smart Metering meter provided by global Energy Providers, need a adapter. See dedicated full [blog](http://hallard.me/category/tinfo/) about French teleinformation stuff
- Library to be used for decoding Teleinfo (French Metering Smart Meter) - Library to be used for decoding Teleinfo (French Metering Smart Meter)
- Support for single wire LMT01 temperature Sensor by justifiably (#8713) - Support for single wire LMT01 temperature Sensor by justifiably (#8713)
- Compile time interlock parameters (#8759) - Compile time interlock parameters (#8759)
@ -3070,7 +3197,7 @@ All notable changes to this project will be documented in this file.
- Fix Zigbee uses Hardware Serial if GPIO 1/3 or GPIO 13/15 and SerialLog 0 (#7071) - Fix Zigbee uses Hardware Serial if GPIO 1/3 or GPIO 13/15 and SerialLog 0 (#7071)
- Fix WS2812 power control (#7090) - Fix WS2812 power control (#7090)
- Change light color schemes 2, 3 and 4 from color wheel to Hue driven with user Saturation control - Change light color schemes 2, 3 and 4 from color wheel to Hue driven with user Saturation control
- Change log buffer size from 520 to 700 characters accomodating full rule text (#7110) - Change log buffer size from 520 to 700 characters accommodating full rule text (#7110)
### 7.1.1 20191201 ### 7.1.1 20191201
@ -3432,7 +3559,7 @@ All notable changes to this project will be documented in this file.
- Add user configurable ADC0 to Module and Template configuration compatible with current FLAG options (#5671) - Add user configurable ADC0 to Module and Template configuration compatible with current FLAG options (#5671)
- Add AriLux RF control GPIO option "ALux IrSel" (159) replacing "Led4i" (59) for full LED control (#5709) - Add AriLux RF control GPIO option "ALux IrSel" (159) replacing "Led4i" (59) for full LED control (#5709)
- Add LED GPIO option "LedLink" (157) and "LedLinki" (158) to select dedicated link status LED (#5709) - Add LED GPIO option "LedLink" (157) and "LedLinki" (158) to select dedicated link status LED (#5709)
- Add all 5 PWM channels individually adressable with LEDs. (#5741) - Add all 5 PWM channels individually addressable with LEDs. (#5741)
- Add reset of Energy values when connection to sensor is lost for over 4 seconds (#5874, #5881) - Add reset of Energy values when connection to sensor is lost for over 4 seconds (#5874, #5881)
- Add checkbox to GUI password field enabling visibility during password entry only (#5934) - Add checkbox to GUI password field enabling visibility during password entry only (#5934)
@ -3460,7 +3587,7 @@ All notable changes to this project will be documented in this file.
- Fix mDNS addService (#4938, #4951) - Fix mDNS addService (#4938, #4951)
- Fix HAss discovery of MHZ19(B) sensors (#4992) - Fix HAss discovery of MHZ19(B) sensors (#4992)
- Fix some exceptions and watchdogs due to lack of stack space (#5215) - Fix some exceptions and watchdogs due to lack of stack space (#5215)
- Fix GUI wifi password acception starting with asteriks (*) (#5231, #5242) - Fix GUI wifi password acception starting with asterisks (*) (#5231, #5242)
- Fix command WebSend intermittent results (#5273, #5304) - Fix command WebSend intermittent results (#5273, #5304)
- Fix additional characters in fallbacktopic, hostname and mqttclient on core 2.5.0 (#5359, #5417) - Fix additional characters in fallbacktopic, hostname and mqttclient on core 2.5.0 (#5359, #5417)
- Fix Energy TotalStartTime when commands EnergyReset0 and/or EnergyReset3 used (#5373) - Fix Energy TotalStartTime when commands EnergyReset0 and/or EnergyReset3 used (#5373)
@ -3710,7 +3837,7 @@ All notable changes to this project will be documented in this file.
- Remove forced restart when sleep command is executed (#3554) - Remove forced restart when sleep command is executed (#3554)
- Fix invalid response using more than 4 switches and domoticz - Fix invalid response using more than 4 switches and domoticz
- Fix sonoff-minimal not using default settings - Fix sonoff-minimal not using default settings
- Fix unsecure main webpage update - Fix insecure main webpage update
- Fix DHT driver mixing values for different sensors (#1797) - Fix DHT driver mixing values for different sensors (#1797)
- Fix EnergyReset3 regression not clearing total energy (#2723) - Fix EnergyReset3 regression not clearing total energy (#2723)
- Fix rules once regression from v6.1.0 (#3198, #3226) - Fix rules once regression from v6.1.0 (#3198, #3226)
@ -3785,10 +3912,10 @@ All notable changes to this project will be documented in this file.
- Add CRC to Settings making future upgrades more fail-safe - Add CRC to Settings making future upgrades more fail-safe
- Add feature information to Status 4 - Add feature information to Status 4
- Add tools folder with python script decode-status.py for decoding some status fields like SetOption and Features - Add tools folder with python script decode-status.py for decoding some status fields like SetOption and Features
- Add Slots on the KNX Web Menu to select Group Addess to receive data to trigger rules - Add Slots on the KNX Web Menu to select Group Address to receive data to trigger rules
- Add two rule sets of 511 characters using commands rule1, rule2 and rule3 - Add two rule sets of 511 characters using commands rule1, rule2 and rule3
- Add Console Commands to send KNX Commands and KNX Values - Add Console Commands to send KNX Commands and KNX Values
- Add Slots on the KNX Web Menu to select Group Addess to send data from console commands - Add Slots on the KNX Web Menu to select Group Address to send data from console commands
- Add Events to trigger rules when a command or read requests is received from KNX - Add Events to trigger rules when a command or read requests is received from KNX
- Add command SetOption30 to enforce Hass discovery as light group (#1784) - Add command SetOption30 to enforce Hass discovery as light group (#1784)
- Add support for BlitzWolf BW-SHP2 (and Homecube, Gosund SP1) Energy Monitoring Smart Socket (#2223) - Add support for BlitzWolf BW-SHP2 (and Homecube, Gosund SP1) Energy Monitoring Smart Socket (#2223)
@ -3861,8 +3988,8 @@ All notable changes to this project will be documented in this file.
- Change user_config_override usage by providing user_config_override_sample.h (#2228) - Change user_config_override usage by providing user_config_override_sample.h (#2228)
- Change MQTT response topic for Energy changes from ENERGY to SENSOR (#2229, #2251) - Change MQTT response topic for Energy changes from ENERGY to SENSOR (#2229, #2251)
- Change default Reset configuration time from 4 seconds to 40 seconds on Button hold (#2268) - Change default Reset configuration time from 4 seconds to 40 seconds on Button hold (#2268)
- Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accomodate rules (#2560) - Change ESP8266 Analog JSON message from {"Analog0:123"} to {"ANALOG":{"A0:123"}} to accommodate rules (#2560)
- Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accomodate rules - Change Counter JSON message from {"Counter1":0,"Counter3":0} to {"COUNTER":{"C1":0,"C3":0}} to accommodate rules
- Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}} - Change ADS1115 JSON message from {"ADS1115":{"Analog0":123,"Analog1":123}} to {"ADS1115":{"A0":123,"A1":123}}
- Fix intermittent exception when dns lookup is used while sleep is enabled - Fix intermittent exception when dns lookup is used while sleep is enabled
- Fix 5.4.0 regression turning off single press after button hold during 4x hold time - Fix 5.4.0 regression turning off single press after button hold during 4x hold time
@ -3870,7 +3997,7 @@ All notable changes to this project will be documented in this file.
- Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1) - Fix NTP sync to Thu Jan 01 08:00:10 1970 results in uptime 17651+ days (core2.4.1/sdk2.2.1)
- Fix MAX31850 higher temperatures (#1269) - Fix MAX31850 higher temperatures (#1269)
- Fix freeing more code space when emulation is disabled (#1592) - Fix freeing more code space when emulation is disabled (#1592)
- Fix providing web page configuratin option for Friendly Name when no device (relay or light) is configured (#1850) - Fix providing web page configuration option for Friendly Name when no device (relay or light) is configured (#1850)
- Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937) - Fix compile error when define HOME_ASSISTANT_DISCOVERY_ENABLE is not set (#1937)
- Fix MQTT TLS fingerprint validation (#2033) - Fix MQTT TLS fingerprint validation (#2033)
- Fix update temperature on DS18x20 drivers (#2328) - Fix update temperature on DS18x20 drivers (#2328)
@ -3934,7 +4061,7 @@ All notable changes to this project will be documented in this file.
- Add multiple color entry support for command Led like Led2 120000 001200 000012 setting led2 as Red, Led3 as Green and Led4 as Blue (#2303) - Add multiple color entry support for command Led like Led2 120000 001200 000012 setting led2 as Red, Led3 as Green and Led4 as Blue (#2303)
- Add hexadecimal RGB color entry on RGBCW leds (#2304) - Add hexadecimal RGB color entry on RGBCW leds (#2304)
- Add support for SGP30 gas and air quality sensor (#2307) - Add support for SGP30 gas and air quality sensor (#2307)
- Add optional Sunrise and Sunset timers with commands Latitide and Longitude to be enabled with define USE_SUNRISE in user_config.h (#2317) - Add optional Sunrise and Sunset timers with commands Latitude and Longitude to be enabled with define USE_SUNRISE in user_config.h (#2317)
- Add timer sunrise and sunset offset (#2378) - Add timer sunrise and sunset offset (#2378)
- Add user selectable defines for Sunrise/set Dawn option (#2378) - Add user selectable defines for Sunrise/set Dawn option (#2378)
- Add optional KNX IP Protocol Support (#2402) - Add optional KNX IP Protocol Support (#2402)
@ -3961,7 +4088,7 @@ All notable changes to this project will be documented in this file.
- Change weblog memory usage (#1730, #1793, #1819) - Change weblog memory usage (#1730, #1793, #1819)
- Update TasmotaSerial library to 1.1.0 - Update TasmotaSerial library to 1.1.0
- Update language files Italian (#1594), Dutch (#1723) and Spanish (#1722) - Update language files Italian (#1594), Dutch (#1723) and Spanish (#1722)
- Fix Non-English JSON temperature unit attachement - Fix Non-English JSON temperature unit attachment
- Fix Arilux RF induced exception by moving interrupt handler to iram on non ESP8266/Arduino lib v2.3.0 - Fix Arilux RF induced exception by moving interrupt handler to iram on non ESP8266/Arduino lib v2.3.0
- Fix truncated command names and wrong response for DomoticzSwitchIdx (#1571) - Fix truncated command names and wrong response for DomoticzSwitchIdx (#1571)
- Fix %-sign issue as printf escape character in Humidity and Sonoff SC (#1579) - Fix %-sign issue as printf escape character in Humidity and Sonoff SC (#1579)
@ -4229,7 +4356,7 @@ All notable changes to this project will be documented in this file.
- Add Sonoff T1 support (#582) - Add Sonoff T1 support (#582)
- Add AnalogInput0 if configured as Analog Input to webpage (#697, #746) - Add AnalogInput0 if configured as Analog Input to webpage (#697, #746)
- Add command SetOption14 0|1 to enable interlock mode (#719, #721) - Add command SetOption14 0|1 to enable interlock mode (#719, #721)
- Fix Mitsubishi HVAC IR power controll (#740) - Fix Mitsubishi HVAC IR power control (#740)
### 5.5.2 20170808 ### 5.5.2 20170808
@ -4259,9 +4386,9 @@ All notable changes to this project will be documented in this file.
- Smoothing WS2812 animation poll, invert fade speed and max allowed wakeup time down to 3000 seconds - Smoothing WS2812 animation poll, invert fade speed and max allowed wakeup time down to 3000 seconds
- Fix initial button press detection - Fix initial button press detection
- Add support for Sonoff RF Bridge 433 using command RfKey - Add support for Sonoff RF Bridge 433 using command RfKey
- Fix regression from 5.0.7 by increasing message buffer size from 360 to 368 to accomodate 4 x DS18x20 sensors (#637) - Fix regression from 5.0.7 by increasing message buffer size from 360 to 368 to accommodate 4 x DS18x20 sensors (#637)
- Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to send either ON/OFF or TOGGLE (#642) - Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to send either ON/OFF or TOGGLE (#642)
- Adjust HLW calibration limits to accomodate HuaFan device and add commands HlwPSet, HlwUSet and HlwISet (#654) - Adjust HLW calibration limits to accommodate HuaFan device and add commands HlwPSet, HlwUSet and HlwISet (#654)
### 5.4.0 20170725 ### 5.4.0 20170725
@ -4439,7 +4566,7 @@ All notable changes to this project will be documented in this file.
### 4.1.3 20170410 ### 4.1.3 20170410
- Add user configuarble GPIO to module S20 Socket and Slampher - Add user configurable GPIO to module S20 Socket and Slampher
- Add support for Sonoff SC (#112) - Add support for Sonoff SC (#112)
- Set PWM frequency from 1000Hz to 910Hz as used on iTead Sonoff Led firmware (#122) - Set PWM frequency from 1000Hz to 910Hz as used on iTead Sonoff Led firmware (#122)
- Set Sonoff Led unconfigured floating outputs to 0 to reduce exceptions due to power supply instabilities (#122) - Set Sonoff Led unconfigured floating outputs to 0 to reduce exceptions due to power supply instabilities (#122)
@ -4500,7 +4627,7 @@ All notable changes to this project will be documented in this file.
- Add PWM output control with commands PWM1 to PWM5 using user selectable GPIOs (#211) - Add PWM output control with commands PWM1 to PWM5 using user selectable GPIOs (#211)
- Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal (1000) and HlwICal (2500) (#223) - Fix exceptions due to low values of commands HlwPCal (10000), HlwUCal (1000) and HlwICal (2500) (#223)
- Add Switch state to sensor status (#227, #233) - Add Switch state to sensor status (#227, #233)
- Add user configuarble GPIO to module Sonoff Touch (#228) - Add user configurable GPIO to module Sonoff Touch (#228)
- Add define WEB_PORT to user_config.h to change default web server port from 80 (#232) - Add define WEB_PORT to user_config.h to change default web server port from 80 (#232)
- Fix failed Ota Firmware upgrade started from Web page (#235) - Fix failed Ota Firmware upgrade started from Web page (#235)
@ -4904,7 +5031,7 @@ All notable changes to this project will be documented in this file.
- Add optional EXPERIMENTAL TLS to MQTT (#49) - Add optional EXPERIMENTAL TLS to MQTT (#49)
- Fix MQTT payload handling (#111) - Fix MQTT payload handling (#111)
- Optimzed WeMo code - Optimized WeMo code
### 2.0.21a 20161201 ### 2.0.21a 20161201
@ -5000,7 +5127,7 @@ All notable changes to this project will be documented in this file.
### 2.0.8 20161108 ### 2.0.8 20161108
- Add initial status after power on - Add initial status after power on
- Seperate driver files - Separate driver files
- Fix hlw code and calibrate Pow - Fix hlw code and calibrate Pow
- Move user config defines to user_config.h (#61) - Move user config defines to user_config.h (#61)
@ -5063,7 +5190,7 @@ All notable changes to this project will be documented in this file.
- Add more lines to console - Add more lines to console
- Add timeout and disable MQTT on web upload - Add timeout and disable MQTT on web upload
- Add command SAVEDATA to control parameter save (for flash wear afficionados) (#30) - Add command SAVEDATA to control parameter save (for flash wear aficionados) (#30)
### 1.0.34 20160926 ### 1.0.34 20160926
@ -5088,7 +5215,7 @@ All notable changes to this project will be documented in this file.
- Fix DS18B20 misread if teleperiod = 2 - Fix DS18B20 misread if teleperiod = 2
- Tuned sensor code - Tuned sensor code
- Updated prefered ElectroDragon connection to Relay 1 and Button 1 - Updated preferred ElectroDragon connection to Relay 1 and Button 1
- Moved SONOFF and ELECTRO_DRAGON port config to user_config.h - Moved SONOFF and ELECTRO_DRAGON port config to user_config.h
### 1.0.30 20160902 ### 1.0.30 20160902
@ -5219,7 +5346,7 @@ All notable changes to this project will be documented in this file.
### 1.0.14 20160722 ### 1.0.14 20160722
- Seperate user config from sonoff.ino to user_config.h (pucebaboon) - Separate user config from sonoff.ino to user_config.h (pucebaboon)
- Change defaults from sidnas2 to domus1 - Change defaults from sidnas2 to domus1
- Add MQTT status message as status 6 (pucebaboon) - Add MQTT status message as status 6 (pucebaboon)
- Add status type to message (pucebaboon) - Add status type to message (pucebaboon)
@ -5264,7 +5391,7 @@ All notable changes to this project will be documented in this file.
- Add UDP syslog support - Add UDP syslog support
- Change HOST command to MQTTHOST command - Change HOST command to MQTTHOST command
- Add commands SYSLOG, SERIALLOG and LOGHOST - Add commands SYSLOG, SERIALLOG and LOGHOST
- Change hostname to lower case to distinguise between open-sdk version - Change hostname to lower case to distinguish between open-sdk version
- Add support for ESP-12F used in my modified wkaku power socket switch - Add support for ESP-12F used in my modified wkaku power socket switch
- Fix timezone command - Fix timezone command
- Add RTC month names for future use - Add RTC month names for future use

8
CMakeLists.txt Normal file
View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.16.0)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(tasmota)
if(CONFIG_IDF_TARGET_ESP32C2)
include(relinker)
endif()

View File

@ -86,7 +86,7 @@ In addition to @arendst the following code is mainly owned by:
| xdrv_72_pipsolar | @chefpro | xdrv_72_pipsolar | @chefpro
| xdrv_73_lora | @arendst | xdrv_73_lora | @arendst
| xdrv_74 | | xdrv_74 |
| xdrv_75 | | xdrv_75_dali | @eeak, @arendst
| xdrv_76 | | xdrv_76 |
| xdrv_77 | | xdrv_77 |
| xdrv_78 | | xdrv_78 |
@ -98,7 +98,7 @@ In addition to @arendst the following code is mainly owned by:
| xdrv_86_esp32_sonoff_spm | @arendst | xdrv_86_esp32_sonoff_spm | @arendst
| xdrv_87_esp32_sonoff_tm1621 | @arendst | xdrv_87_esp32_sonoff_tm1621 | @arendst
| xdrv_88_esp32_shelly_pro | @arendst | xdrv_88_esp32_shelly_pro | @arendst
| xdrv_89_esp32_dali | @eeak | xdrv_89_ |
| xdrv_90_esp32_dingtian_relay | @barbudor | xdrv_90_esp32_dingtian_relay | @barbudor
| xdrv_91_ | | xdrv_91_ |
| xdrv_92_ | | xdrv_92_ |

View File

@ -126,4 +126,7 @@ Index | Define | Driver | Device | Address(es) | Bus2 | Descrip
86 | USE_AMSX915 | xsns_114 | AMS6915 | 0x28 | | Pressure (absolute/differential) and temperature sensor 86 | USE_AMSX915 | xsns_114 | AMS6915 | 0x28 | | Pressure (absolute/differential) and temperature sensor
87 | USE_SPL06_007 | xsns_25 | SPL06-007 | 0x76 | | Pressure and temperature sensor 87 | USE_SPL06_007 | xsns_25 | SPL06-007 | 0x76 | | Pressure and temperature sensor
88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor 88 | USE_QMP6988 | xsns_28 | QMP6988 | 0x56, 0x70 | Yes | Pressure and temperature sensor
89 | USE_HX711_M5SCALES | xsns_34 | M5SCALES | 0x26 | Yes | M5Unit (Mini)Scales(HX711 STM32) U177
90 | USE_RX8010 | xdrv_56 | RX8010 | 0x32 | Yes | RX8010 RTC from IOTTIMER
NOTE: Bus2 supported on ESP32 only. NOTE: Bus2 supported on ESP32 only.

View File

@ -34,16 +34,11 @@ While fallback or downgrading is common practice it was never supported due to S
## Supported Core versions ## Supported Core versions
This release will be supported from ESP8266/Arduino library Core version **2.7.7** due to reported security and stability issues on previous Core version. This will also support gzipped binaries. This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries.
This release will be supported from ESP32/Arduino library Core version **3.0.4**. This release will be supported from ESP32/Arduino library Core version **v3.1.0.240926**.
Support of ESP8266 Core versions before 2.7.7 and ESP32 Core versions before 3.0.4 have been removed. Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.0.240926 have been removed.
### Known issues with v14.2.0
Due to the change from ESP32 Arduino Core2/IDF4 to Arduino Core3/IDF5 not all functionality has been restored. The following features are known not to work on ESP32:
- Wifi Range Extender [#21200](https://github.com/arendst/Tasmota/issues/21200)
## Support of TLS ## Support of TLS
@ -60,7 +55,7 @@ Easy initial installation of Tasmota can be performed using the [Tasmota WebInst
## Provided Binary Downloads ## Provided Binary Downloads
### ESP8266 or ESP8285 based ### ESP8266 or ESP8285 based
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.7**. The following binary downloads have been compiled with ESP8266/Arduino library core version **2.7.8**.
- **tasmota.bin** = The Tasmota version with most drivers for 1M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota.bin** = The Tasmota version with most drivers for 1M+ flash. **RECOMMENDED RELEASE BINARY**
- **tasmota-4M.bin** = The Tasmota version with most drivers and filesystem for 4M+ flash. - **tasmota-4M.bin** = The Tasmota version with most drivers and filesystem for 4M+ flash.
@ -80,12 +75,12 @@ Latest released binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release - http://ota.tasmota.com/tasmota/release
Historical binaries can be downloaded from Historical binaries can be downloaded from
- http://ota.tasmota.com/tasmota/release-14.2.0 - http://ota.tasmota.com/tasmota/release-14.3.0
The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz``
### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based ### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based
The following binary downloads have been compiled with ESP32/Arduino library core version **3.0.4**. The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.0.240926**.
- **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY**
- **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash. - **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash.
@ -109,7 +104,7 @@ Latest released binaries can be downloaded from
- https://ota.tasmota.com/tasmota32/release - https://ota.tasmota.com/tasmota32/release
Historical binaries can be downloaded from Historical binaries can be downloaded from
- https://ota.tasmota.com/tasmota32/release-14.2.0 - https://ota.tasmota.com/tasmota32/release-14.3.0
The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin`` The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin``
@ -119,100 +114,83 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
[Complete list](BUILDS.md) of available feature and sensors. [Complete list](BUILDS.md) of available feature and sensors.
## Changelog v14.2.0 Rita ## Changelog v14.3.0 Robert
### Added ### Added
- Command ``AdcGpio<gpio> <parameters>`` to better support ADC configuration - Command ``SetOption69 1`` to enable Serial Bridge inverted Receive [#22000](https://github.com/arendst/Tasmota/issues/22000)
- Support for QMP6988 temperature and pressure sensor - HX711 optional calibration precision option on command ``Sensor34 2 <weight in gram> <precision>`` where `<precision>` is 1 to 20 [#13983](https://github.com/arendst/Tasmota/issues/13983)
- Support for Sonoff WTS01 temperature sensor using SerialBridge in ``SSerialMode 3`` - ESP8266 support for one-wire M1601 temperature sensor on DS18x20 GPIO [#21376](https://github.com/arendst/Tasmota/issues/21376)
- Support for Sonoff iFan04-H using template [#16402](https://github.com/arendst/Tasmota/issues/16402) - ESP8266 support for I2C CLK on GPIO16 [#22199](https://github.com/arendst/Tasmota/issues/22199)
- Support for Sonoff POWCT Ring [#21131](https://github.com/arendst/Tasmota/issues/21131) - Support for I2C M5Unit (Mini)Scales using HX711 driver
- Support for Wooliis Hall Effect Coulometer or Battery capacity monitor [#21732](https://github.com/arendst/Tasmota/issues/21732) - Support for DALI 1 on ESP8266
- Analog GPIO ``ADC Input`` with ``AdcGpio<pin> <start_range>,<end_range>,<margin>,1`` provide direct light control - Support for RX8010 RTC as used in IOTTIMER [#21376](https://github.com/arendst/Tasmota/issues/21376)
- Analog GPIO ``ADC Voltage`` with ``AdcGpio<pin> <start_range>,<end_range>,<lowest_voltage>,<highest_voltage>`` provide energy monitoring with dc voltage - Support for BL0906 up to 6 channel energy monitor as used in Athom EM2/EM6 [#22167](https://github.com/arendst/Tasmota/issues/22167)
- Analog GPIO ``ADC Current`` with ``AdcGpio<pin> <start_range>,<end_range>,<lowest_current>,<highest_current>`` provide energy monitoring with dc voltage - Support for Sonoff SPM v1.3.0 [#13447](https://github.com/arendst/Tasmota/issues/13447)
- Rule and Scripter xdrv sensor polling - Energy command ``PowerSet 60,230`` to calibrate both Current and Power with known resistive load of 60W at 230V using calibrated Voltage
- Skip MQTT response if command is prefixed with underscore [#21740](https://github.com/arendst/Tasmota/issues/21740) - Energy command ``CurrentSet 60,230`` to calibrate both Power and Current with known resistive load of 60W at 230V using calibrated Voltage
- Skip MQTT response if commands are executed prefixed with ``Backlog2`` (no delay) or ``Backlog3`` [#21740](https://github.com/arendst/Tasmota/issues/21740) - ESP8266 experimental support for second I2C bus
- Extend command ``SetOption147 1`` to disable publish of IRReceived MQTT messages [#21574](https://github.com/arendst/Tasmota/issues/21574) - MQTT warning if trying to connect without TLS on a port that normally uses TLS [#22175](https://github.com/arendst/Tasmota/issues/22175)
- NeoPool command `NPSetOption<x>` to enabled/disable data validation/connection statistics [#21850](https://github.com/arendst/Tasmota/issues/21850) - Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration [#20653](https://github.com/arendst/Tasmota/issues/20653)
- NeoPool data validation and communication statistics default enabled for ESP32 only [#21721](https://github.com/arendst/Tasmota/issues/21721) - Support nexus protocol and calculation of separation limit to rc-switch library [#21886](https://github.com/arendst/Tasmota/issues/21886)
- ESP32 support for power and energy limit checks, like ``MaxEnergy2`` per phase [#21695](https://github.com/arendst/Tasmota/issues/21695) - KNX additional KnxTx functions and define KNX_USE_DPT9 [#22071](https://github.com/arendst/Tasmota/issues/22071)
- Berry solidification of `bytes` instances [#21558](https://github.com/arendst/Tasmota/issues/21558) - SML multi TRX line [#22056](https://github.com/arendst/Tasmota/issues/22056)
- Berry automatic rounding of float to int when calling C mapped functions [#21601](https://github.com/arendst/Tasmota/issues/21601) - Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro [#22076](https://github.com/arendst/Tasmota/issues/22076)
- Berry `math.round` [#21602](https://github.com/arendst/Tasmota/issues/21602) - Berry Zigbee improvements to prepare Matter [#22083](https://github.com/arendst/Tasmota/issues/22083)
- Berry `classof` extended to class methods [#21615](https://github.com/arendst/Tasmota/issues/21615) - Berry virtual Energy driver [#22134](https://github.com/arendst/Tasmota/issues/22134)
- Berry `tasmota.rtc("config_time")` [#21698](https://github.com/arendst/Tasmota/issues/21698) - Berry improve `int64` constructor [#22172](https://github.com/arendst/Tasmota/issues/22172)
- Berry `math.min()` and `math.max()` [#21705](https://github.com/arendst/Tasmota/issues/21705) - LVGL port `colorwheel` from LVGL 8 [#22244](https://github.com/arendst/Tasmota/issues/22244)
- Berry `FUNC_ANY_KEY` event calling `any_key()` [#21708](https://github.com/arendst/Tasmota/issues/21708) - HASPmota `cpicker` and `msgbox` [#22244](https://github.com/arendst/Tasmota/issues/22244)
- Berry `FUNC_BUTTON_MULTI_PRESSED` event and make `FUNC_BUTTON_PRESSED` called only on state changes and once per second [#21711](https://github.com/arendst/Tasmota/issues/21711) - Matter support for Zigbee Temperature, Humidity and Pressure sensors [#22084](https://github.com/arendst/Tasmota/issues/22084)
- Berry `int64` added `low32()` and `high32()` methods, used in Matter [#21728](https://github.com/arendst/Tasmota/issues/21728) - Matter support for Zigbee Occupancy and Light 0/1/2 (OnOff / Dimmer / White Color Temperature) [#22110](https://github.com/arendst/Tasmota/issues/22110)
- Berry `webserver_async` [#21836](https://github.com/arendst/Tasmota/issues/21836)
- Berry cam module and img class [#21743](https://github.com/arendst/Tasmota/issues/21743)
- Berry new type "addr" to ctypes mapping [#21883](https://github.com/arendst/Tasmota/issues/21883)
- Berry `file.savecode()` [#21884](https://github.com/arendst/Tasmota/issues/21884)
- Berry `solidify.nocompact()` and reduce size of Matter UI [#21885](https://github.com/arendst/Tasmota/issues/21885)
- Berry `zigbee.find()` [#21889](https://github.com/arendst/Tasmota/issues/21889)
- Berry `zigbee.started()` [#21895](https://github.com/arendst/Tasmota/issues/21895)
- HASPmota rounds to nearest int values passed as 'real' [#21599](https://github.com/arendst/Tasmota/issues/21599)
- Matter support for Air Quality sensors [#21559](https://github.com/arendst/Tasmota/issues/21559)
- Matter support for bridged Air Quality [#21597](https://github.com/arendst/Tasmota/issues/21597)
- Matter internal debug option [#21634](https://github.com/arendst/Tasmota/issues/21634)
- Matter Fan support (virtual only) [#21637](https://github.com/arendst/Tasmota/issues/21637)
- Matter show event name in logs [#21649](https://github.com/arendst/Tasmota/issues/21649)
- Matter full support of events [#21698](https://github.com/arendst/Tasmota/issues/21698)
- Matter support for 'Generic Switch' based on Tasmota Buttons [#21731](https://github.com/arendst/Tasmota/issues/21731)
- Matter improve internal `inspect`for superclasses [#21824](https://github.com/arendst/Tasmota/issues/21824)
- Matter support for split lights (`SetOption68 1` and `SetOption37 128`) [#21834](https://github.com/arendst/Tasmota/issues/21834)
### Breaking Changed ### Breaking Changed
- Berry `energy` module support for 8 phases and move to pseudo-arrays [#21887](https://github.com/arendst/Tasmota/issues/21887) - Berry make `energy` modules changes from #21887 backwards compatible [#22046](https://github.com/arendst/Tasmota/issues/22046)
### Changed ### Changed
- ESP8266 platform update from 2024.01.01 to 2024.06.00 [#21668](https://github.com/arendst/Tasmota/issues/21668) - ESP8266 platform update from 2024.06.00 to 2024.09.00 and Framework (Arduino Core) from v2.7.7 to v2.7.8 [#22199](https://github.com/arendst/Tasmota/issues/22199)
- ESP8266 Framework (Arduino Core) from v2.7.6 to v2.7.7 [#21668](https://github.com/arendst/Tasmota/issues/21668) - ESP32 platform update from 2024.08.10 to 2024.09.30 and Framework (Arduino Core) from v3.0.4 to v3.1.0.240926 [#22203](https://github.com/arendst/Tasmota/issues/22203)
- ESP32 platform update from 2024.05.13 to 2024.08.10 [#21893](https://github.com/arendst/Tasmota/issues/21893) - ESP32 LVGL library from v9.1.0 to v9.2.0 [#22031](https://github.com/arendst/Tasmota/issues/22031)
- ESP32 Framework (Arduino Core) from v3.0.0 to v3.0.4 [#21893](https://github.com/arendst/Tasmota/issues/21893) - GPIOViewer from v1.5.5 to v1.5.6
- Rule and Scripter sensor polling - Add command entered to command error and command unknown message
- Refactored Analog driver to better support multiple channels - Refactored I2C drivers HTU21, BH1750, SHT3x, iAQ and HYT
- GUI name of Analog<x> to ADC<x> - Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere
- Optional MQTT_TELE_RETAIN to Energy Margins message replaced by ``SensorRetain`` - Energy force Apparent Power equals Active Power when (Calculated) Apparent Power is less than Active Power [#20653](https://github.com/arendst/Tasmota/issues/20653)
- Display timing splash screen with display modes 1 to 5 - Refactor and fix PID sensor (PID_USE_LOCAL_SENSOR) read race condition [#22162](https://github.com/arendst/Tasmota/issues/22162)
- Allow receive or send using SerialBridge - SCD30 Lowered I2C clock from 100k to 50k [#15438](https://github.com/arendst/Tasmota/issues/15438)
- SerialBridge command ``SSerialSend9`` replaced by ``SSerialMode`` - HASPmota `delete` instead of `delete()` [#22245](https://github.com/arendst/Tasmota/issues/22245)
- SML replace vars in descriptor and line [#21622](https://github.com/arendst/Tasmota/issues/21622)
- NeoPool using temperature as only frequently changing value for NPTeleperiod [#21628](https://github.com/arendst/Tasmota/issues/21628)
- NeoPool make compiler setting available by `user_config_override.h` [#21645](https://github.com/arendst/Tasmota/issues/21645)
- ESP32 support for energy margin checks, like ``MaxPower2`` per phase [#21695](https://github.com/arendst/Tasmota/issues/21695)
- ESP32 MI32 refactoring, bugfixes, generic device scanning [#21603](https://github.com/arendst/Tasmota/issues/21603)
- ESP32 MI32 improve parser [#21648](https://github.com/arendst/Tasmota/issues/21648)
- ESP32 TM1621 number overflow from "9999" to "12E3" [#21131](https://github.com/arendst/Tasmota/issues/21131)
- Zigbee loads device data early before MCU startup [#21917](https://github.com/arendst/Tasmota/issues/21917)
- Berry updated precompiled Windows binary [#21858](https://github.com/arendst/Tasmota/issues/21858)
- Berry simplified `module persist` [#21812](https://github.com/arendst/Tasmota/issues/21812)
- Berry consolidated constants for solidified classes reduces Flash size [#2185](https://github.com/arendst/Tasmota/issues/2185)
- Matter refactoring of bridged devices [#21575](https://github.com/arendst/Tasmota/issues/21575)
- Matter filter suffix automatically added for sensors [#21589](https://github.com/arendst/Tasmota/issues/21589)
- Matter support for Rain sensor [#21633](https://github.com/arendst/Tasmota/issues/21633)
- Matter refactor reading of multiple attributes to reduce memory pressure [#21675](https://github.com/arendst/Tasmota/issues/21675)
- Matter improve encoding of attributes to reduce flash size [#21864](https://github.com/arendst/Tasmota/issues/21864)
### Fixed ### Fixed
- On universal display remove default backlight power if a single PWM channel is used for backlight. Regression from 14.0.0.1 [#21726](https://github.com/arendst/Tasmota/issues/21726) - Dali received data decoding
- Shutter MQTT on inverted shutter [#21663](https://github.com/arendst/Tasmota/issues/21663) - Compilation exception when metrics not found [#22170](https://github.com/arendst/Tasmota/issues/22170)
- Scripter TCP server [#21660](https://github.com/arendst/Tasmota/issues/21660) - Crash when calling TasmotaSerial destructor when initialized with incorrect arguments [#22036](https://github.com/arendst/Tasmota/issues/22036)
- Filesystem SD MMC free space display [#21869](https://github.com/arendst/Tasmota/issues/21869) - Energy calculation [#20653](https://github.com/arendst/Tasmota/issues/20653)
- ESP32 allow use of UART0 with enabled USB_CDC_CONSOLE [#21496](https://github.com/arendst/Tasmota/issues/21496) - SML trx pin error [#22119](https://github.com/arendst/Tasmota/issues/22119)
- ESP32 I2S fixes [#21770](https://github.com/arendst/Tasmota/issues/21770) - Shutter timing registers overflow [#21966](https://github.com/arendst/Tasmota/issues/21966)
- ESP32 Resistive Touch xpt for 2 spi busses [#21814](https://github.com/arendst/Tasmota/issues/21814) - Shutter missing HOLD on shutterbutton [#22108](https://github.com/arendst/Tasmota/issues/22108)
- Berry `input()` returns empty string and does not crash [#21565](https://github.com/arendst/Tasmota/issues/21565) - Shutter remaining issues on shutterinvert [#22120](https://github.com/arendst/Tasmota/issues/22120)
- Berry `bytes.resize()` for large sizes [#21716](https://github.com/arendst/Tasmota/issues/21716) - PZEM continue energy monitoring when one phase fails [#21968](https://github.com/arendst/Tasmota/issues/21968)
- Berry `light.get` for separate RGB/CT [#21818](https://github.com/arendst/Tasmota/issues/21818) - BearSSL panic on ESP8266 in rare conditions [#22017](https://github.com/arendst/Tasmota/issues/22017)
- Berry `bytes` setters and getters with negative offsets [#21835](https://github.com/arendst/Tasmota/issues/21835) - ModbusBridge request and response logic [#22075](https://github.com/arendst/Tasmota/issues/22075)
- Berry `file.write()` raises an exception on failure (ex: disk full) [#21849](https://github.com/arendst/Tasmota/issues/21849) - Autoconf prevent 'init.bat' from stopping on empty lines [#22158](https://github.com/arendst/Tasmota/issues/22158)
- Matter interverted attributes 0xFFF9 and 0xFFFB [#21636](https://github.com/arendst/Tasmota/issues/21636) - Zigbee extend timeout for MCU reboot from 5s to 10s [#22009](https://github.com/arendst/Tasmota/issues/22009)
- Matter CASE Sigma1 resumption mode for faster reconnection [#21644](https://github.com/arendst/Tasmota/issues/21644) - Zigbee avoid disabling console serial on ESP32 and improved log messages [#22082](https://github.com/arendst/Tasmota/issues/22082)
- Matter TLV.U8 unsigned encoding [#21672](https://github.com/arendst/Tasmota/issues/21672) - Zigbee flashing CC2562P with latest firmware [#22117](https://github.com/arendst/Tasmota/issues/22117)
- Matter resumption final ack [#21673](https://github.com/arendst/Tasmota/issues/21673) - ESP32 Range Extender compile error with core 3.x [#22205](https://github.com/arendst/Tasmota/issues/22205)
- ESP32 Dali compile error with core 3.x [#22214](https://github.com/arendst/Tasmota/issues/22214)
- ESP32 Ethernet using EthClockMode 3 [#22248](https://github.com/arendst/Tasmota/issues/22248)
- Berry avoid `readbytes()` from crashing when file is too large [#22057](https://github.com/arendst/Tasmota/issues/22057)
- Berry energy missing attributes [#22116](https://github.com/arendst/Tasmota/issues/22116)
- Berry I2C to prepare M5Stack I2C STM32 based devices [#22143](https://github.com/arendst/Tasmota/issues/22143)
- Berry improve `persist` dirty data handling [#22246](https://github.com/arendst/Tasmota/issues/22246)
- ESP32-S3 uDisplay force cache writes to RGB display [#22222](https://github.com/arendst/Tasmota/issues/22222)
- LVGL Added OpenHASP icons to font `montserrat-28` [#22048](https://github.com/arendst/Tasmota/issues/22048)
- LVGL compilation of lv_menu [#22188](https://github.com/arendst/Tasmota/issues/22188)
- HASPmota broken `changed` event [#22194](https://github.com/arendst/Tasmota/issues/22194)
- HASPmota error when page '1' is not defined [#22220](https://github.com/arendst/Tasmota/issues/22220)
- Matter fixed UI bug when no endpoints configured [#22008](https://github.com/arendst/Tasmota/issues/22008)
- Matter fix when Rules are disabled [#22016](https://github.com/arendst/Tasmota/issues/22016)
- Matter fail to report Shutter status if no shutter is configured in Tasmota [#22049](https://github.com/arendst/Tasmota/issues/22049)
- Matter fix Waterleak broken after Berry solidification optimisation #21885 [#22052](https://github.com/arendst/Tasmota/issues/22052)
### Removed ### Removed
- Berry internal: remove class from closure to simplify code [#21839](https://github.com/arendst/Tasmota/issues/21839) - ESP8266 Analog input support using energy driver as only one channel is available
- Berry remove reuse of methods for interface-like code reuse #21500 [#22055](https://github.com/arendst/Tasmota/issues/22055)

View File

@ -19,7 +19,8 @@
"openocd_target": "esp32.cfg" "openocd_target": "esp32.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32 >= 4M Flash, PSRAM with fix, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32 >= 4M Flash, PSRAM with fix, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -19,7 +19,8 @@
"openocd_target": "esp32.cfg" "openocd_target": "esp32.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -19,7 +19,8 @@
"openocd_target": "esp32-solo-1.cfg" "openocd_target": "esp32-solo-1.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-solo1 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-solo1 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c2.cfg" "openocd_target": "esp32c2.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C2 = 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-C2 = 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c2.cfg" "openocd_target": "esp32c2.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C2 = 2M Flash, Tasmota 1245kB Code/OTA, 64k FS", "name": "Espressif Generic ESP32-C2 = 2M Flash, Tasmota 1245kB Code/OTA, 64k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c3.cfg" "openocd_target": "esp32c3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c3.cfg" "openocd_target": "esp32c3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-C3 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c6.cfg" "openocd_target": "esp32c6.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -17,7 +17,8 @@
"openocd_target": "esp32c6.cfg" "openocd_target": "esp32c6.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-C6 >= 4M Flash, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -16,7 +16,8 @@
"openocd_target": "esp32s2.cfg" "openocd_target": "esp32s2.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -16,7 +16,8 @@
"openocd_target": "esp32s2.cfg" "openocd_target": "esp32s2.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S2 >= 4M Flash PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -23,7 +23,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -23,7 +23,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -23,7 +23,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -23,7 +23,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M OPI Flash + PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M Flash OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -23,7 +23,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M QIO Flash + OPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -21,7 +21,8 @@
"openocd_target": "esp32s3.cfg" "openocd_target": "esp32s3.cfg"
}, },
"frameworks": [ "frameworks": [
"arduino" "arduino",
"espidf"
], ],
"name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS", "name": "Espressif Generic ESP32-S3 >= 4M Flash QSPI PSRAM, Tasmota 2880k Code/OTA, 320k FS",
"upload": { "upload": {

View File

@ -123,8 +123,10 @@ void TasmotaSerial::end(void) {
} }
TasmotaSerial::~TasmotaSerial(void) { TasmotaSerial::~TasmotaSerial(void) {
if (m_valid) {
end(); end();
} }
}
bool TasmotaSerial::isValidGPIOpin(int pin) { bool TasmotaSerial::isValidGPIOpin(int pin) {
#ifdef ESP8266 #ifdef ESP8266

View File

@ -106,6 +106,7 @@ public:
dim_cb dim_cbp = 0; dim_cb dim_cbp = 0;
LVGL_PARAMS lvgl_param; LVGL_PARAMS lvgl_param;
int8_t disp_bpp; int8_t disp_bpp;
uint16_t *rgb_fb;
private: private:
void DrawCharAt(int16_t x, int16_t y, char ascii_char,int16_t colored); void DrawCharAt(int16_t x, int16_t y, char ascii_char,int16_t colored);
inline void drawFastVLineInternal(int16_t x, int16_t y, int16_t h, uint16_t color) __attribute__((always_inline)); inline void drawFastVLineInternal(int16_t x, int16_t y, int16_t h, uint16_t color) __attribute__((always_inline));

View File

@ -2282,14 +2282,11 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) {
} }
} }
uint16_t * flush_ptr = rgb_fb + (int32_t)seta_yp1 * _width + seta_xp1; uint16_t * flush_ptr = rgb_fb + (int32_t)seta_yp1 * _width + seta_xp1;
esp_cache_msync(flush_ptr, (seta_xp2 - seta_xp1) * 2, 0); Cache_WriteBack_Addr((uint32_t)flush_ptr, (seta_xp2 - seta_xp1) * 2);
fb_y += _width; fb_y += _width;
seta_yp1++; seta_yp1++;
if (!lenc) break; if (!lenc) break;
} }
// using esp_cache_msync() to flush the PSRAM cache and ensure that all data is actually written to PSRAM
// from https://github.com/espressif/esp-idf/blob/636ff35b52f10e1a804a3760a5bd94e68f4b1b71/components/esp_lcd/rgb/esp_lcd_panel_rgb.c#L159
} }
#endif #endif
return; return;

View File

@ -396,7 +396,7 @@ class uDisplay : public Renderer {
#if ESP_IDF_VERSION_MAJOR < 5 #if ESP_IDF_VERSION_MAJOR < 5
esp_rgb_panel_t *_rgb_panel; esp_rgb_panel_t *_rgb_panel;
#endif //ESP_IDF_VERSION_MAJOR < 5 #endif //ESP_IDF_VERSION_MAJOR < 5
uint16_t *rgb_fb;
esp_lcd_i80_bus_handle_t _i80_bus = nullptr; esp_lcd_i80_bus_handle_t _i80_bus = nullptr;

View File

@ -152,7 +152,8 @@ static const RCSwitch::Protocol PROGMEM proto[] = {
{ 120, 0, { 0, 0 }, 1, { 1, 28 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 34 DIGOO SD10 - so as to use this protocol RCSWITCH_SEPARATION_LIMIT must be set to 2600 { 120, 0, { 0, 0 }, 1, { 1, 28 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 34 DIGOO SD10 - so as to use this protocol RCSWITCH_SEPARATION_LIMIT must be set to 2600
{ 20, 0, { 0, 0 }, 1, { 239, 78 }, {20, 35 }, {35, 20}, false, 10000},// 35 Dooya 5-Channel blinds remote DC1603 { 20, 0, { 0, 0 }, 1, { 239, 78 }, {20, 35 }, {35, 20}, false, 10000},// 35 Dooya 5-Channel blinds remote DC1603
{ 250, 0, { 0, 0 }, 1, { 18, 6 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 36 Dooya remote DC2700AC for Dooya DT82TV curtains motor { 250, 0, { 0, 0 }, 1, { 18, 6 }, { 1, 3 }, { 3, 1 }, false, 0 }, // 36 Dooya remote DC2700AC for Dooya DT82TV curtains motor
{ 200, 0, { 0, 0 }, 0, { 0, 0 }, { 1, 3 }, { 3, 1} , false, 20} // 37 DEWENWILS Power Strip { 200, 0, { 0, 0 }, 0, { 0, 0 }, { 1, 3 }, { 3, 1 }, false, 20 }, // 37 DEWENWILS Power Strip
{ 500, 0, { 0, 0 }, 1, { 7, 1 }, { 2, 1 }, { 4, 1 }, true, 0 }, // 38 temperature and humidity sensor, various brands, nexus protocol, 36 bits + start impulse
}; };
enum { enum {
@ -166,7 +167,7 @@ volatile unsigned int RCSwitch::nReceivedBitlength = 0;
volatile unsigned int RCSwitch::nReceivedDelay = 0; volatile unsigned int RCSwitch::nReceivedDelay = 0;
volatile unsigned int RCSwitch::nReceivedProtocol = 0; volatile unsigned int RCSwitch::nReceivedProtocol = 0;
int RCSwitch::nReceiveTolerance = 60; int RCSwitch::nReceiveTolerance = 60;
const unsigned int RCSwitch::nSeparationLimit = RCSWITCH_SEPARATION_LIMIT; unsigned int RCSwitch::nSeparationLimit = RCSWITCH_SEPARATION_LIMIT;
unsigned int RCSwitch::timings[RCSWITCH_MAX_CHANGES]; unsigned int RCSwitch::timings[RCSWITCH_MAX_CHANGES];
unsigned int RCSwitch::buftimings[4]; unsigned int RCSwitch::buftimings[4];
#endif #endif
@ -238,8 +239,50 @@ void RCSwitch::setReceiveTolerance(int nPercent) {
RCSwitch::nReceiveTolerance = nPercent; RCSwitch::nReceiveTolerance = nPercent;
} }
void RCSwitch::setReceiveProtocolMask(unsigned long long mask) { bool RCSwitch::setReceiveProtocolMask(unsigned long long mask) {
RCSwitch::nReceiveProtocolMask = mask; RCSwitch::nReceiveProtocolMask = mask;
return updateSeparationLimit();
}
bool RCSwitch::updateSeparationLimit()
{
unsigned int longestPulseTime = std::numeric_limits<unsigned int>::max();
unsigned int shortestPulseTime = 0;
unsigned long long thisMask = 1;
for(unsigned int i = 0; i < numProto; i++) {
if (RCSwitch::nReceiveProtocolMask & thisMask) {
const unsigned int headerShortPulseCount = std::min(proto[i].Header.high, proto[i].Header.low);
const unsigned int headerLongPulseCount = std::max(proto[i].Header.high, proto[i].Header.low);
// This must be the longest pulse-length of this protocol. nSeparationLimit must of this length or shorter.
// This pulse will be used to detect the beginning of a transmission.
const unsigned int headerLongPulseTime = proto[i].pulseLength * headerLongPulseCount;
// nSeparationLimit must be longer than any of the following pulses to avoid detecting a new transmission in the middle of a frame.
unsigned int longestDataPulseCount = headerShortPulseCount;
longestDataPulseCount = std::max<unsigned int>(longestDataPulseCount, proto[i].zero.high);
longestDataPulseCount = std::max<unsigned int>(longestDataPulseCount, proto[i].zero.low);
longestDataPulseCount = std::max<unsigned int>(longestDataPulseCount, proto[i].one.high);
longestDataPulseCount = std::max<unsigned int>(longestDataPulseCount, proto[i].one.low);
const unsigned int longestDataPulseTime = proto[i].pulseLength * longestDataPulseCount;
longestPulseTime = std::min(longestPulseTime, headerLongPulseTime);
shortestPulseTime = std::max(shortestPulseTime, longestDataPulseTime);
}
thisMask <<= 1;
}
if (longestPulseTime <= shortestPulseTime) {
// incompatible protocols enabled, fall back to default value
nSeparationLimit = RCSWITCH_SEPARATION_LIMIT;
return false;
}
const unsigned int timeDiff = longestPulseTime - shortestPulseTime;
nSeparationLimit = longestPulseTime - (timeDiff / 2);
return true;
} }
#endif #endif

View File

@ -57,9 +57,9 @@
#endif #endif
// Number of maximum high/Low changes per packet. // Number of maximum high/Low changes per packet.
// We can handle up to (unsigned long) => 32 bit * 2 H/L changes per bit + 2 for sync // We can handle up to 36 bit * 2 H/L changes per bit + 2 for sync
// Для keeloq нужно увеличить RCSWITCH_MAX_CHANGES до 23+1+66*2+1=157 // Для keeloq нужно увеличить RCSWITCH_MAX_CHANGES до 23+1+66*2+1=157
#define RCSWITCH_MAX_CHANGES 67 // default 67 #define RCSWITCH_MAX_CHANGES 75 // default 75 - longest protocol that requires this buffer size is 38/nexus
// separationLimit: minimum microseconds between received codes, closer codes are ignored. // separationLimit: minimum microseconds between received codes, closer codes are ignored.
// according to discussion on issue #14 it might be more suitable to set the separation // according to discussion on issue #14 it might be more suitable to set the separation
@ -108,7 +108,7 @@ class RCSwitch {
void setRepeatTransmit(int nRepeatTransmit); void setRepeatTransmit(int nRepeatTransmit);
#if not defined( RCSwitchDisableReceiving ) #if not defined( RCSwitchDisableReceiving )
void setReceiveTolerance(int nPercent); void setReceiveTolerance(int nPercent);
void setReceiveProtocolMask(unsigned long long mask); bool setReceiveProtocolMask(unsigned long long mask);
#endif #endif
/** /**
@ -171,6 +171,7 @@ class RCSwitch {
#if not defined( RCSwitchDisableReceiving ) #if not defined( RCSwitchDisableReceiving )
static void handleInterrupt(); static void handleInterrupt();
static bool receiveProtocol(const int p, unsigned int changeCount); static bool receiveProtocol(const int p, unsigned int changeCount);
static bool updateSeparationLimit();
int nReceiverInterrupt; int nReceiverInterrupt;
#endif #endif
int nTransmitterPin; int nTransmitterPin;
@ -184,7 +185,7 @@ class RCSwitch {
volatile static unsigned int nReceivedBitlength; volatile static unsigned int nReceivedBitlength;
volatile static unsigned int nReceivedDelay; volatile static unsigned int nReceivedDelay;
volatile static unsigned int nReceivedProtocol; volatile static unsigned int nReceivedProtocol;
const static unsigned int nSeparationLimit; static unsigned int nSeparationLimit;
/* /*
* timings[0] contains sync timing, followed by a number of bits * timings[0] contains sync timing, followed by a number of bits
*/ */

View File

@ -465,7 +465,7 @@ run_code(jacobian *P1, const jacobian *P2,
memcpy(t[P1x], P1->c, 3 * I15_LEN * sizeof(uint16_t)); memcpy(t[P1x], P1->c, 3 * I15_LEN * sizeof(uint16_t));
memcpy(t[P2x], P2->c, 3 * I15_LEN * sizeof(uint16_t)); memcpy(t[P2x], P2->c, 3 * I15_LEN * sizeof(uint16_t));
optimistic_yield(10000); stack_thunk_yield();
/* /*
* Run formulas. * Run formulas.

View File

@ -141,7 +141,7 @@ br_rsa_i15_private(unsigned char *x, const br_rsa_private_key *sk)
mp = mq + 2 * fwlen; mp = mq + 2 * fwlen;
memmove(mp, t1, fwlen * sizeof *t1); memmove(mp, t1, fwlen * sizeof *t1);
optimistic_yield(10000); stack_thunk_yield();
/* /*
* Compute s2 = x^dq mod q. * Compute s2 = x^dq mod q.
@ -152,7 +152,7 @@ br_rsa_i15_private(unsigned char *x, const br_rsa_private_key *sk)
r &= br_i15_modpow_opt(s2, sk->dq, sk->dqlen, mq, q0i, r &= br_i15_modpow_opt(s2, sk->dq, sk->dqlen, mq, q0i,
mq + 3 * fwlen, TLEN - 3 * fwlen); mq + 3 * fwlen, TLEN - 3 * fwlen);
optimistic_yield(10000); stack_thunk_yield();
/* /*
* Compute s1 = x^dq mod q. * Compute s1 = x^dq mod q.
@ -184,7 +184,7 @@ br_rsa_i15_private(unsigned char *x, const br_rsa_private_key *sk)
br_i15_decode_reduce(t1, sk->iq, sk->iqlen, mp); br_i15_decode_reduce(t1, sk->iq, sk->iqlen, mp);
br_i15_montymul(t2, s1, t1, mp, p0i); br_i15_montymul(t2, s1, t1, mp, p0i);
optimistic_yield(10000); stack_thunk_yield();
/* /*
* h is now in t2. We compute the final result: * h is now in t2. We compute the final result:

View File

@ -2598,16 +2598,16 @@ br_cpuid(uint32_t mask_eax, uint32_t mask_ebx,
#define _debugBearSSL (0) #define _debugBearSSL (0)
#ifdef ESP8266 #ifdef ESP8266
extern void optimistic_yield(uint32_t); extern void stack_thunk_yield(void);
#else #else
#define optimistic_yield(ignored) #define stack_thunk_yield(ignored)
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#else #else
#define optimistic_yield(ignored) #define stack_thunk_yield(ignored)
#endif #endif
#ifdef ESP32 #ifdef ESP32

View File

@ -35,6 +35,9 @@
extern "C" { extern "C" {
extern void yield();
extern bool can_yield();
uint32_t *stack_thunk_light_ptr = NULL; uint32_t *stack_thunk_light_ptr = NULL;
uint32_t *stack_thunk_light_top = NULL; uint32_t *stack_thunk_light_top = NULL;
uint32_t *stack_thunk_light_save = NULL; /* Saved A1 while in BearSSL */ uint32_t *stack_thunk_light_save = NULL; /* Saved A1 while in BearSSL */
@ -48,6 +51,25 @@ uint32_t stack_thunk_light_refcnt = 0;
#endif #endif
#define _stackPaint 0xdeadbeef #define _stackPaint 0xdeadbeef
void stack_thunk_yield()
{
if (can_yield()) {
uint32_t tmp;
register uint32_t* save __asm__("a3") = stack_thunk_light_save;
__asm__ __volatile__ (
"mov.n %0, a1\n\t"
"mov.n a1, %1\n\t"
: "=r"(tmp) : "r"(save) : "memory");
yield();
__asm__ __volatile__ (
"mov.n a1, %0\n\t"
:: "r"(tmp) : "memory");
}
}
/* Add a reference, and allocate the stack if necessary */ /* Add a reference, and allocate the stack if necessary */
void stack_thunk_light_add_ref() void stack_thunk_light_add_ref()
{ {

View File

@ -32,6 +32,8 @@
extern "C" { extern "C" {
#endif #endif
extern void stack_thunk_yield();
extern void stack_thunk_light_add_ref(); extern void stack_thunk_light_add_ref();
extern void stack_thunk_light_del_ref(); extern void stack_thunk_light_del_ref();
extern void stack_thunk_light_repaint(); extern void stack_thunk_light_repaint();

Binary file not shown.

View File

@ -55,6 +55,7 @@ be_extern_native_module(TFL);
be_extern_native_module(mdns); be_extern_native_module(mdns);
#ifdef USE_ZIGBEE #ifdef USE_ZIGBEE
be_extern_native_module(zigbee); be_extern_native_module(zigbee);
be_extern_native_module(matter_zigbee);
#endif // USE_ZIGBEE #endif // USE_ZIGBEE
#ifdef USE_BERRY_CAM #ifdef USE_BERRY_CAM
be_extern_native_module(cam); be_extern_native_module(cam);
@ -171,6 +172,7 @@ BERRY_LOCAL const bntvmodule_t* const be_module_table[] = {
#endif // USE_WEBSERVER #endif // USE_WEBSERVER
#ifdef USE_ZIGBEE #ifdef USE_ZIGBEE
&be_native_module(zigbee), &be_native_module(zigbee),
&be_native_module(matter_zigbee),
#endif // USE_ZIGBEE #endif // USE_ZIGBEE
&be_native_module(flash), &be_native_module(flash),
&be_native_module(partition_core), &be_native_module(partition_core),

View File

@ -547,7 +547,7 @@ void m_write_attributes(bvm *vm, int rel_idx, const buf_impl * attr)
} }
// buf_impl * bytes_realloc(bvm *vm, buf_impl *oldbuf, int32_t size) // buf_impl * bytes_realloc(bvm *vm, buf_impl *oldbuf, int32_t size)
void bytes_realloc(bvm *vm, buf_impl * attr, int32_t size) void bytes_realloc(bvm *vm, buf_impl * attr, size_t size)
{ {
m_assert_not_readlonly(vm, attr); m_assert_not_readlonly(vm, attr);
if (!attr->fixed && size < 4) { size = 4; } if (!attr->fixed && size < 4) { size = 4; }
@ -1180,7 +1180,7 @@ static int m_item(bvm *vm)
{ {
int argc = be_top(vm); int argc = be_top(vm);
buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */ buf_impl attr = bytes_check_data(vm, 0); /* we reserve 4 bytes anyways */
check_ptr_modifiable(vm, &attr); check_ptr(vm, &attr);
if (argc >=2 && be_isint(vm, 2)) { /* single byte */ if (argc >=2 && be_isint(vm, 2)) { /* single byte */
int index = be_toint(vm,2); int index = be_toint(vm,2);
if (index < 0) { if (index < 0) {

View File

@ -307,7 +307,7 @@ static int exp2const(bfuncinfo *finfo, bexpdesc *e)
{ {
int idx = findconst(finfo, e); /* does the constant already exist? */ int idx = findconst(finfo, e); /* does the constant already exist? */
if (idx == -1) { /* if not add it */ if (idx == -1) { /* if not add it */
bvalue k = {}; bvalue k = {0};
switch (e->type) { switch (e->type) {
case ETINT: case ETINT:
k.type = BE_INT; k.type = BE_INT;
@ -695,7 +695,7 @@ static void setsfxvar(bfuncinfo *finfo, bopcode op, bexpdesc *e1, int src)
/* e1 must be in a register and have a valid idx */ /* e1 must be in a register and have a valid idx */
/* if `keep_reg` is true, do not release register */ /* if `keep_reg` is true, do not release register */
/* return 1 if assignment was possible, 0 if type is not compatible */ /* return 1 if assignment was possible, 0 if type is not compatible */
int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg, bbool ismethod) int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg)
{ {
/* free_e2 indicates special case where ETINDEX or ETMEMBER need to be freed if top of registers */ /* free_e2 indicates special case where ETINDEX or ETMEMBER need to be freed if top of registers */
bbool free_e2 = (e2->type == ETINDEX || e2->type == ETMEMBER) && (e2->v.ss.idx != e1->v.idx) && (e2->v.ss.idx == finfo->freereg - 1); bbool free_e2 = (e2->type == ETINDEX || e2->type == ETMEMBER) && (e2->v.ss.idx != e1->v.idx) && (e2->v.ss.idx == finfo->freereg - 1);
@ -729,7 +729,7 @@ int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg,
break; break;
case ETMEMBER: /* store to member R(A).RK(B) <- RK(C) */ case ETMEMBER: /* store to member R(A).RK(B) <- RK(C) */
case ETINDEX: /* store to member R(A)[RK(B)] <- RK(C) */ case ETINDEX: /* store to member R(A)[RK(B)] <- RK(C) */
setsfxvar(finfo, (e1->type == ETMEMBER) ? (ismethod ? OP_SETMET : OP_SETMBR) : OP_SETIDX, e1, src); setsfxvar(finfo, (e1->type == ETMEMBER) ? OP_SETMBR : OP_SETIDX, e1, src);
if (keep_reg && e2->type == ETREG && e1->v.ss.obj >= be_list_count(finfo->local)) { if (keep_reg && e2->type == ETREG && e1->v.ss.obj >= be_list_count(finfo->local)) {
/* special case of walrus assignemnt when we need to recreate an ETREG */ /* special case of walrus assignemnt when we need to recreate an ETREG */
code_move(finfo, e1->v.ss.obj, src); /* move from ETREG to MEMBER instance*/ code_move(finfo, e1->v.ss.obj, src); /* move from ETREG to MEMBER instance*/
@ -882,7 +882,7 @@ void be_code_index(bfuncinfo *finfo, bexpdesc *c, bexpdesc *k)
void be_code_class(bfuncinfo *finfo, bexpdesc *dst, bclass *c) void be_code_class(bfuncinfo *finfo, bexpdesc *dst, bclass *c)
{ {
int src; int src;
bvalue var = {}; bvalue var = {0};
var_setclass(&var, c); /* new var of CLASS type */ var_setclass(&var, c); /* new var of CLASS type */
src = newconst(finfo, &var); /* allocate a new constant and return kreg */ src = newconst(finfo, &var); /* allocate a new constant and return kreg */
if (dst->type == ETLOCAL) { /* if target is a local variable, just assign */ if (dst->type == ETLOCAL) { /* if target is a local variable, just assign */
@ -923,7 +923,7 @@ void be_code_import(bfuncinfo *finfo, bexpdesc *m, bexpdesc *v)
codeABC(finfo, OP_IMPORT, dst, src, 0); codeABC(finfo, OP_IMPORT, dst, src, 0);
m->type = ETREG; m->type = ETREG;
m->v.idx = dst; m->v.idx = dst;
be_code_setvar(finfo, v, m, bfalse, bfalse); be_code_setvar(finfo, v, m, bfalse);
} }
} }
@ -965,7 +965,7 @@ void be_code_raise(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2)
void be_code_implicit_class(bfuncinfo *finfo, bexpdesc *e, bclass *c) void be_code_implicit_class(bfuncinfo *finfo, bexpdesc *e, bclass *c)
{ {
bvalue k = {}; bvalue k = {0};
k.type = BE_CLASS; k.type = BE_CLASS;
k.v.p = c; k.v.p = c;
int idx = newconst(finfo, &k); /* create new constant */ int idx = newconst(finfo, &k); /* create new constant */

View File

@ -16,7 +16,7 @@ int be_code_allocregs(bfuncinfo *finfo, int count);
void be_code_prebinop(bfuncinfo *finfo, int op, bexpdesc *e); void be_code_prebinop(bfuncinfo *finfo, int op, bexpdesc *e);
void be_code_binop(bfuncinfo *finfo, int op, bexpdesc *e1, bexpdesc *e2, int dst); void be_code_binop(bfuncinfo *finfo, int op, bexpdesc *e1, bexpdesc *e2, int dst);
int be_code_unop(bfuncinfo *finfo, int op, bexpdesc *e); int be_code_unop(bfuncinfo *finfo, int op, bexpdesc *e);
int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg, bbool ismethod); int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2, bbool keep_reg);
int be_code_nextreg(bfuncinfo *finfo, bexpdesc *e); int be_code_nextreg(bfuncinfo *finfo, bexpdesc *e);
int be_code_jump(bfuncinfo *finfo); int be_code_jump(bfuncinfo *finfo);
void be_code_jumpto(bfuncinfo *finfo, int dst); void be_code_jumpto(bfuncinfo *finfo, int dst);

View File

@ -62,7 +62,7 @@ void be_print_inst(binstruction ins, int pc, void* fout)
case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV:
case OP_MOD: case OP_LT: case OP_LE: case OP_EQ: case OP_MOD: case OP_LT: case OP_LE: case OP_EQ:
case OP_NE: case OP_GT: case OP_GE: case OP_CONNECT: case OP_NE: case OP_GT: case OP_GE: case OP_CONNECT:
case OP_GETMBR: case OP_SETMBR: case OP_GETMET: case OP_SETMET: case OP_GETMBR: case OP_SETMBR: case OP_GETMET:
case OP_GETIDX: case OP_SETIDX: case OP_AND: case OP_GETIDX: case OP_SETIDX: case OP_AND:
case OP_OR: case OP_XOR: case OP_SHL: case OP_SHR: case OP_OR: case OP_XOR: case OP_SHL: case OP_SHR:
logbuf("%s\tR%d\t%c%d\t%c%d", opc2str(op), IGET_RA(ins), logbuf("%s\tR%d\t%c%d\t%c%d", opc2str(op), IGET_RA(ins),

View File

@ -10,6 +10,7 @@
#include "be_sys.h" #include "be_sys.h"
#include "be_gc.h" #include "be_gc.h"
#include "be_bytecode.h" #include "be_bytecode.h"
#include "be_vm.h"
#include <string.h> #include <string.h>
#define READLINE_STEP 100 #define READLINE_STEP 100
@ -71,12 +72,23 @@ static int i_readbytes(bvm *vm)
void *fh = be_tocomptr(vm, -1); void *fh = be_tocomptr(vm, -1);
size_t size = readsize(vm, argc, fh); size_t size = readsize(vm, argc, fh);
if (size) { if (size) {
if (size > vm->bytesmaxsize) {
be_raise(vm, "memory_error", "size exceeds maximum allowed for bytes");
}
/* avoid double allocation, using directly the internal buffer of bytes() */ /* avoid double allocation, using directly the internal buffer of bytes() */
be_getbuiltin(vm, "bytes"); be_getbuiltin(vm, "bytes");
be_pushint(vm, size); be_pushint(vm, size);
be_call(vm, 1); /* call bytes() constructor with pre-sized buffer */ be_call(vm, 1); /* call bytes() constructor with pre-sized buffer */
be_pop(vm, 1); /* bytes() instance is at top */ be_pop(vm, 1); /* bytes() instance is at top */
/* read back the actual buffer size */
be_getmember(vm, -1, ".size");
int32_t bytes_size = be_toint(vm, -1);
be_pop(vm, 1);
if (bytes_size < (int32_t)size) {
be_raise(vm, "memory_error", "could not allocated buffer");
}
be_getmember(vm, -1, "resize"); be_getmember(vm, -1, "resize");
be_pushvalue(vm, -2); be_pushvalue(vm, -2);
be_pushint(vm, size); be_pushint(vm, size);

View File

@ -355,7 +355,7 @@ int be_module_attr(bvm *vm, bmodule *module, bstring *attr, bvalue *dst)
bbool be_module_setmember(bvm *vm, bmodule *module, bstring *attr, bvalue *src) bbool be_module_setmember(bvm *vm, bmodule *module, bstring *attr, bvalue *src)
{ {
assert(src); be_assert(src);
bmap *attrs = module->table; bmap *attrs = module->table;
if (!gc_isconst(attrs)) { if (!gc_isconst(attrs)) {
bvalue *v = be_map_findstr(vm, attrs, attr); bvalue *v = be_map_findstr(vm, attrs, attr);

View File

@ -54,5 +54,4 @@ OPCODE(CATCH), /* A, B, C | ... */
OPCODE(RAISE), /* A, B, C | RAISE(B,C) B is code, C is description. A==0 only B provided, A==1 B and C are provided, A==2 rethrow with both parameters already on stack */ OPCODE(RAISE), /* A, B, C | RAISE(B,C) B is code, C is description. A==0 only B provided, A==1 B and C are provided, A==2 rethrow with both parameters already on stack */
OPCODE(CLASS), /* Bx | init class in K[Bx] */ OPCODE(CLASS), /* Bx | init class in K[Bx] */
OPCODE(GETNGBL), /* A, B | R(A) <- GLOBAL[RK(B)] by name */ OPCODE(GETNGBL), /* A, B | R(A) <- GLOBAL[RK(B)] by name */
OPCODE(SETNGBL), /* A, B | R(A) -> GLOBAL[RK(B)] by name */ OPCODE(SETNGBL) /* A, B | R(A) -> GLOBAL[RK(B)] by name */
OPCODE(SETMET), /* A, B, C | R(A).RK(B) <- RK(C) only if R(A) is a class, and RK(C) is marked as non-static */

View File

@ -634,7 +634,7 @@ static bproto* funcbody(bparser *parser, bstring *name, bclass *c, int type)
new_var(parser, parser_newstr(parser, "_class"), &e1); /* new implicit variable '_class' */ new_var(parser, parser_newstr(parser, "_class"), &e1); /* new implicit variable '_class' */
init_exp(&e2, ETCONST, 0); init_exp(&e2, ETCONST, 0);
be_code_implicit_class(parser->finfo, &e2, c); be_code_implicit_class(parser->finfo, &e2, c);
be_code_setvar(parser->finfo, &e1, &e2, bfalse, bfalse); be_code_setvar(parser->finfo, &e1, &e2, bfalse);
finfo.proto->varg |= BE_VA_STATICMETHOD; finfo.proto->varg |= BE_VA_STATICMETHOD;
} }
stmtlist(parser); /* parse statement without final `end` */ stmtlist(parser); /* parse statement without final `end` */
@ -738,7 +738,7 @@ static void map_nextmember(bparser *parser, bexpdesc *l)
match_token(parser, OptColon); /* ':' */ match_token(parser, OptColon); /* ':' */
expr(parser, &e); /* value in `e` */ expr(parser, &e); /* value in `e` */
check_var(parser, &e); /* check if value is correct */ check_var(parser, &e); /* check if value is correct */
be_code_setvar(finfo, &v, &e, bfalse, bfalse); /* set suffi INDEX value to e */ be_code_setvar(finfo, &v, &e, bfalse); /* set suffi INDEX value to e */
} }
static void list_expr(bparser *parser, bexpdesc *e) static void list_expr(bparser *parser, bexpdesc *e)
@ -1018,7 +1018,7 @@ static void assign_expr(bparser *parser)
if (check_newvar(parser, &e)) { /* new variable */ if (check_newvar(parser, &e)) { /* new variable */
new_var(parser, e.v.s, &e); new_var(parser, e.v.s, &e);
} }
if (be_code_setvar(parser->finfo, &e, &e1, bfalse, bfalse)) { if (be_code_setvar(parser->finfo, &e, &e1, bfalse)) {
parser->lexer.linenumber = line; parser->lexer.linenumber = line;
parser_error(parser, parser_error(parser,
"try to assign constant expressions."); "try to assign constant expressions.");
@ -1121,7 +1121,7 @@ static void walrus_expr(bparser *parser, bexpdesc *e)
if (check_newvar(parser, &e1)) { /* new variable */ if (check_newvar(parser, &e1)) { /* new variable */
new_var(parser, e1.v.s, &e1); new_var(parser, e1.v.s, &e1);
} }
if (be_code_setvar(parser->finfo, &e1, e, btrue /* do not release register */, bfalse)) { if (be_code_setvar(parser->finfo, &e1, e, btrue /* do not release register */ )) {
parser->lexer.linenumber = line; parser->lexer.linenumber = line;
parser_error(parser, parser_error(parser,
"try to assign constant expressions."); "try to assign constant expressions.");
@ -1254,7 +1254,7 @@ static void for_iter(bparser *parser, bstring *var, bexpdesc *it)
finfo->binfo->beginpc = finfo->pc; finfo->binfo->beginpc = finfo->pc;
/* itvar = .it() */ /* itvar = .it() */
init_exp(&e, ETLOCAL, new_localvar(parser, var)); /* new itvar */ init_exp(&e, ETLOCAL, new_localvar(parser, var)); /* new itvar */
be_code_setvar(finfo, &e, it, bfalse, bfalse); /* code function to variable '.it' */ be_code_setvar(finfo, &e, it, bfalse); /* code function to variable '.it' */
be_code_call(finfo, e.v.idx, 0); /* itvar <- call .it() */ be_code_call(finfo, e.v.idx, 0); /* itvar <- call .it() */
stmtlist(parser); stmtlist(parser);
} }
@ -1435,7 +1435,7 @@ static void classvar_stmt(bparser *parser, bclass *c)
} }
} }
static void class_static_assignment_expr(bparser *parser, bexpdesc *e, bstring *name, bbool ismethod) static void class_static_assignment_expr(bparser *parser, bexpdesc *e, bstring *name)
{ {
if (match_skip(parser, OptAssign)) { /* '=' */ if (match_skip(parser, OptAssign)) { /* '=' */
bexpdesc e1, e2; bexpdesc e1, e2;
@ -1448,33 +1448,23 @@ static void class_static_assignment_expr(bparser *parser, bexpdesc *e, bstring *
key.v.s = name; key.v.s = name;
be_code_member(parser->finfo, &e1, &key); /* compute member accessor */ be_code_member(parser->finfo, &e1, &key); /* compute member accessor */
be_code_setvar(parser->finfo, &e1, &e2, bfalse, ismethod); /* set member */ be_code_setvar(parser->finfo, &e1, &e2, bfalse); /* set member */
} }
} }
static void classdef_stmt(bparser *parser, bclass *c, bexpdesc *e, bbool is_static) static void classdef_stmt(bparser *parser, bclass *c, bbool is_static)
{ {
bexpdesc e1; bexpdesc e;
bstring *name; bstring *name;
bproto *proto; bproto *proto;
/* 'def' ID '(' varlist ')' block 'end' */ /* 'def' ID '(' varlist ')' block 'end' */
/* 'def' ID = funcname */
/* 'def' ID = classname '.' method */
scan_next_token(parser); /* skip 'def' */ scan_next_token(parser); /* skip 'def' */
name = func_name(parser, &e1, 1); name = func_name(parser, &e, 1);
check_class_attr(parser, c, name); /* check that we don't redefine an existing name within the class */ check_class_attr(parser, c, name);
if (next_type(parser) == OptAssign) {
/* 'def' ID = funcname */
/* 'def' ID = classname '.' method */
be_class_member_bind(parser->vm, c, name, bfalse);
class_static_assignment_expr(parser, e, name, !is_static);
} else {
/* 'def' ID '(' varlist ')' block 'end' */
proto = funcbody(parser, name, c, is_static ? FUNC_STATIC : FUNC_METHOD); proto = funcbody(parser, name, c, is_static ? FUNC_STATIC : FUNC_METHOD);
be_class_method_bind(parser->vm, c, proto->name, proto, is_static); be_class_method_bind(parser->vm, c, proto->name, proto, is_static);
be_stackpop(parser->vm, 1); be_stackpop(parser->vm, 1);
} }
}
static void classstaticclass_stmt(bparser *parser, bclass *c_out, bexpdesc *e_out); static void classstaticclass_stmt(bparser *parser, bclass *c_out, bexpdesc *e_out);
@ -1483,10 +1473,9 @@ static void classstatic_stmt(bparser *parser, bclass *c, bexpdesc *e)
bstring *name; bstring *name;
/* 'static' ['var'] ID ['=' expr] {',' ID ['=' expr] } */ /* 'static' ['var'] ID ['=' expr] {',' ID ['=' expr] } */
/* 'static' 'def' ID '(' varlist ')' block 'end' */ /* 'static' 'def' ID '(' varlist ')' block 'end' */
/* 'static' 'def' ID '=' func */
scan_next_token(parser); /* skip 'static' */ scan_next_token(parser); /* skip 'static' */
if (next_type(parser) == KeyDef) { /* 'static' 'def' ... */ if (next_type(parser) == KeyDef) { /* 'static' 'def' ... */
classdef_stmt(parser, c, e, btrue); classdef_stmt(parser, c, btrue);
} else if (next_type(parser) == KeyClass) { /* 'static' 'class' ... */ } else if (next_type(parser) == KeyClass) { /* 'static' 'class' ... */
classstaticclass_stmt(parser, c, e); classstaticclass_stmt(parser, c, e);
} else { } else {
@ -1496,13 +1485,13 @@ static void classstatic_stmt(bparser *parser, bclass *c, bexpdesc *e)
if (match_id(parser, name) != NULL) { if (match_id(parser, name) != NULL) {
check_class_attr(parser, c, name); check_class_attr(parser, c, name);
be_class_member_bind(parser->vm, c, name, bfalse); be_class_member_bind(parser->vm, c, name, bfalse);
class_static_assignment_expr(parser, e, name, bfalse); class_static_assignment_expr(parser, e, name);
while (match_skip(parser, OptComma)) { /* ',' */ while (match_skip(parser, OptComma)) { /* ',' */
if (match_id(parser, name) != NULL) { if (match_id(parser, name) != NULL) {
check_class_attr(parser, c, name); check_class_attr(parser, c, name);
be_class_member_bind(parser->vm, c, name, bfalse); be_class_member_bind(parser->vm, c, name, bfalse);
class_static_assignment_expr(parser, e, name, bfalse); class_static_assignment_expr(parser, e, name);
} else { } else {
parser_error(parser, "class static error"); parser_error(parser, "class static error");
} }
@ -1532,7 +1521,7 @@ static void class_block(bparser *parser, bclass *c, bexpdesc *e)
switch (next_type(parser)) { switch (next_type(parser)) {
case KeyVar: classvar_stmt(parser, c); break; case KeyVar: classvar_stmt(parser, c); break;
case KeyStatic: classstatic_stmt(parser, c, e); break; case KeyStatic: classstatic_stmt(parser, c, e); break;
case KeyDef: classdef_stmt(parser, c, e, bfalse); break; case KeyDef: classdef_stmt(parser, c, bfalse); break;
case OptSemic: scan_next_token(parser); break; case OptSemic: scan_next_token(parser); break;
default: push_error(parser, default: push_error(parser,
"unexpected token '%s'", token2str(parser)); "unexpected token '%s'", token2str(parser));
@ -1559,7 +1548,7 @@ static void class_stmt(bparser *parser)
bexpdesc e1; /* if inline class, we add a second local variable for _class */ bexpdesc e1; /* if inline class, we add a second local variable for _class */
init_exp(&e1, ETLOCAL, 0); init_exp(&e1, ETLOCAL, 0);
e1.v.idx = new_localvar(parser, class_str); e1.v.idx = new_localvar(parser, class_str);
be_code_setvar(parser->finfo, &e1, &e, btrue, bfalse); be_code_setvar(parser->finfo, &e1, &e, btrue);
begin_varinfo(parser, class_str); begin_varinfo(parser, class_str);
@ -1597,7 +1586,7 @@ static void classstaticclass_stmt(bparser *parser, bclass *c_out, bexpdesc *e_ou
key.v.s = name; key.v.s = name;
/* assign the class to the static member */ /* assign the class to the static member */
be_code_member(parser->finfo, &e1, &key); /* compute member accessor */ be_code_member(parser->finfo, &e1, &key); /* compute member accessor */
be_code_setvar(parser->finfo, &e1, &e_class, bfalse, bfalse); /* set member */ be_code_setvar(parser->finfo, &e1, &e_class, bfalse); /* set member */
} else { } else {
parser_error(parser, "class name error"); parser_error(parser, "class name error");
} }
@ -1649,7 +1638,7 @@ static void var_field(bparser *parser)
init_exp(&e2, ETNIL, 0); init_exp(&e2, ETNIL, 0);
} }
new_var(parser, name, &e1); /* new variable */ new_var(parser, name, &e1); /* new variable */
be_code_setvar(parser->finfo, &e1, &e2, bfalse, bfalse); be_code_setvar(parser->finfo, &e1, &e2, bfalse);
} }
static void var_stmt(bparser *parser) static void var_stmt(bparser *parser)

View File

@ -699,7 +699,7 @@ static void m_compact_class(bvm *vm, bbool str_literal, const bclass *cla, void*
case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV:
case OP_MOD: case OP_LT: case OP_LE: case OP_EQ: case OP_MOD: case OP_LT: case OP_LE: case OP_EQ:
case OP_NE: case OP_GT: case OP_GE: case OP_CONNECT: case OP_NE: case OP_GT: case OP_GE: case OP_CONNECT:
case OP_GETMBR: case OP_SETMBR: case OP_GETMET: case OP_SETMET: case OP_GETMBR: case OP_SETMBR: case OP_GETMET:
case OP_GETIDX: case OP_SETIDX: case OP_AND: case OP_GETIDX: case OP_SETIDX: case OP_AND:
case OP_OR: case OP_XOR: case OP_SHL: case OP_SHR: case OP_OR: case OP_XOR: case OP_SHL: case OP_SHR:
case OP_RAISE: case OP_RAISE:

View File

@ -994,7 +994,6 @@ newframe: /* a new call frame */
} }
dispatch(); dispatch();
} }
opcase(SETMET):
opcase(SETMBR): { opcase(SETMBR): {
#if BE_USE_PERF_COUNTERS #if BE_USE_PERF_COUNTERS
vm->counter_set++; vm->counter_set++;
@ -1021,7 +1020,7 @@ newframe: /* a new call frame */
bclass *obj = var_toobj(a); bclass *obj = var_toobj(a);
bstring *attr = var_tostr(b); bstring *attr = var_tostr(b);
bvalue result = *c; bvalue result = *c;
if (var_isfunction(&result) && (IGET_OP(ins) == OP_SETMBR)) { /* don't mark as static if SETMET was used */ if (var_isfunction(&result)) {
var_markstatic(&result); var_markstatic(&result);
} }
if (!be_class_setmember(vm, obj, attr, &result)) { if (!be_class_setmember(vm, obj, attr, &result)) {

View File

@ -110,7 +110,7 @@ struct bvm {
struct bgc gc; struct bgc gc;
bctypefunc ctypefunc; /* handler to ctype_func */ bctypefunc ctypefunc; /* handler to ctype_func */
bbyte compopt; /* compilation options */ bbyte compopt; /* compilation options */
int32_t bytesmaxsize; /* max allowed size for bytes() object, default 32kb but can be increased */ size_t bytesmaxsize; /* max allowed size for bytes() object, default 32kb but can be increased */
bobshook obshook; bobshook obshook;
bmicrosfnct microsfnct; /* fucntion to get time as a microsecond resolution */ bmicrosfnct microsfnct; /* fucntion to get time as a microsecond resolution */
#if BE_USE_PERF_COUNTERS #if BE_USE_PERF_COUNTERS

View File

@ -0,0 +1,136 @@
# tests for int64 support (for int32 internal int representation)
assert(int(int64()) == 0)
assert(str(int64()) == "0")
assert(int(int64(10)) == 10)
assert(str(int64(10)) == "10")
assert(int(int64(-5)) == -5)
assert(str(int64(-5)) == "-5")
# extended constructor
assert(int64(35).tostring() == "35")
assert(int64(3.5).tostring() == "3")
assert(int64("35").tostring() == "35")
assert(int64("20000000000").tostring() == "20000000000")
assert(int64(true).tostring() == "1")
assert(int64(false).tostring() == "0")
assert(int64(int64(42)).tostring() == "42")
# invalid
assert(int64("").tostring() == "0")
assert(int64(nil).tostring() == "0")
# testing large numbers
assert(str(int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF)) == "9223372036854775807") # max positive number
assert(str(int64.fromu32(0x00000000, 0x80000000)) == "-9223372036854775808")
assert(str(int64.fromu32(10,10)) == "42949672970")
# addition
assert(str(int64(10) + int64(20)) == "30")
assert(str(int64(10) + int64(-20)) == "-10")
assert(str(int64() + int64()) == "0")
assert(str(int64(10) + 0) == "10") # special case, do not crash if null
# substraction
assert(str(int64(10) - int64(20)) == "-10")
assert(str(int64(10) - int64(-20)) == "30")
assert(str(int64() - int64()) == "0")
assert(str(int64(10) - 0) == "10") # special case, do not crash if null
# neg
assert(str(-int64(10)) == "-10")
assert(str(-int64(-10)) == "10")
assert(str(-int64()) == "0")
# multiplication
assert(str(int64(10) * int64(20)) == "200")
assert(str(int64(10) * int64(-20)) == "-200")
assert(str(int64() * int64()) == "0")
assert(str(int64(10) * 0) == "0") # special case, do not crash if null
# division
assert(str(int64(100) / int64(20)) == "5")
assert(str(int64(100) / int64(-20)) == "-5")
# modulus
assert(str(int64(102) % int64(10)) == "2")
# equals
assert((int64(10) == int64(10)) == true)
assert((int64(10) == int64(20)) == false)
assert((int64(10) == int64()) == false)
assert((int64(0) == int64()) == true)
assert((int64(0) == 0) == true)
assert((int64(10) == 0) == false)
# unequals
assert((int64(10) != int64(10)) == false)
assert((int64(10) != int64(20)) == true)
assert((int64(10) != int64()) == true)
assert((int64(0) != int64()) == false)
assert((int64(0) != 0) == false)
assert((int64(10) != 0) == true)
# >
assert((int64(10) > int64(10)) == false)
assert((int64(10) > int64(20)) == false)
assert((int64(20) > int64(10)) == true)
assert((int64(10) > 0) == true)
# >=
assert((int64(10) >= int64(10)) == true)
assert((int64(10) >= int64(20)) == false)
assert((int64(20) >= int64(10)) == true)
assert((int64(10) >= 0) == true)
# <
assert((int64(10) < int64(10)) == false)
assert((int64(10) < int64(20)) == true)
assert((int64(20) < int64(10)) == false)
assert((int64(10) < 0) == false)
# <=
assert((int64(10) <= int64(10)) == true)
assert((int64(10) <= int64(20)) == true)
assert((int64(20) <= int64(10)) == false)
assert((int64(10) <= 0) == false)
# tobytes
assert(int64().tobytes() == bytes("0000000000000000"))
assert(int64(10).tobytes() == bytes("0A00000000000000"))
a = int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF) # max positive number
assert(a.tobytes() == bytes("FFFFFFFFFFFFFF7F"))
a = int64.fromu32(0x00000000, 0x80000000)
assert(a.tobytes() == bytes("0000000000000080"))
assert(int64(-1).tobytes() == bytes("FFFFFFFFFFFFFFFF"))
# frombytes
assert(int64.frombytes(bytes("0A00000000000000"), 0) == bytes("0A00000000000000")) # with implicit index 0
assert(int64.frombytes(bytes("0A00000000000000")) == bytes("0A00000000000000"))
assert(int64.frombytes(bytes("0A00000000000000"), 1) == bytes("0000000000000000")) # index 1 and incomplete (7 bytes)
assert(int64.frombytes(bytes("00FFFFFFFFFFFFFFFF"), 1) == bytes("FFFFFFFFFFFFFFFF")) # index 1 and incomplete (7 bytes)
assert(int64.frombytes(bytes("00FFFFFFFFFFFFFFFF"), -2) == bytes("FFFF000000000000")) # from end
assert(int64.frombytes(bytes("")) == bytes("0000000000000000")) # empty
assert(int64.frombytes(bytes(""),4) == bytes("0000000000000000")) # empty with wrong index
# fromu32
assert(int64.fromu32(0).tobytes() == bytes("0000000000000000"))
assert(int64.fromu32(0xFFFFFFFF).tobytes() == bytes("FFFFFFFF00000000"))
assert(int64.fromu32(0xFFFFFFFF, 1).tobytes() == bytes("FFFFFFFF01000000"))
assert(int64.fromu32(-1, 1).tobytes() == bytes("FFFFFFFF01000000"))
assert(int64.fromu32(-1, -1).tobytes() == bytes("FFFFFFFFFFFFFFFF"))
# fromfloat
assert(int64.fromfloat(3.5).tostring() == "3")
assert(int64.fromfloat(-3.5).tostring() == "-3")
assert(int64.fromfloat(2e10).tostring() == "20000000000") # 20000000000 does not fit in 32 bits
# toint64, supports int, float, bool, string, int64
assert(int64.toint64(35).tostring() == "35")
assert(int64.toint64(3.5).tostring() == "3")
assert(int64.toint64("35").tostring() == "35")
assert(int64.toint64("20000000000").tostring() == "20000000000")
assert(int64.toint64(true).tostring() == "1")
assert(int64.toint64(false).tostring() == "0")
assert(int64.toint64(int64(42)).tostring() == "42")
# invalid
assert(int64.toint64("").tostring() == "0")
assert(int64.toint64(nil) == nil)

View File

@ -1,40 +0,0 @@
# test setting methods as an external class
class A
var a
def init(a)
self.a = a
end
def f0(x) return self end
def f1(x) return x end
def f2(x) return self.a end
static def ff0(x) return _class end
static def ff1(x) return x end
end
class B
var b
def init(b)
self.b = b
end
end
class C : B
var a
def init(a)
self.a = a
end
def fc0 = A.f0
def fc1 = A.f1
def fc2 = A.f2
static def ffc0 = A.ff0
static def ffc1 = A.ff1
end
c = C(10)
assert(c.fc0(1) == c)
assert(c.fc1(1) == 1)
assert(c.fc2(1) == 10)
assert(c.ffc0(1) == A)
assert(c.ffc1(1) == 1)

View File

@ -32,23 +32,70 @@ static void int64_toa(int64_t num, uint8_t* str) {
} }
} }
void* int64_init(bvm *vm, int32_t val) { /* constructor*/
int64_t *i64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); static int int64_init(bvm *vm) {
*i64 = (int64_t) val; int32_t argc = be_top(vm); // Get the number of arguments
// serial_debug("int64_init p=%p\n", i64); int64_t *i64 = NULL;
return i64; /* did we receive a pre-allocated pointer */
if (argc > 1 && be_iscomptr(vm, 2)) {
i64 = be_tocomptr(vm, 2);
}
/* or allocated */
if (i64 == NULL) {
i64 = (int64_t*)be_malloc(vm, sizeof(int64_t));
if (i64 == NULL) { be_raise(vm, "memory_error", "cannot allocate buffer"); }
*i64 = 0; // default to zero
}
bbool invalid_arg = bfalse;
if (argc > 1) {
if (be_iscomptr(vm, 2) || be_isnil(vm, 2)) {
/* keep value */
} else if (be_isint(vm, 2)) {
*i64 = be_toint(vm, 2);
} else if (be_isreal(vm, 2)) {
*i64 = (int64_t)be_toreal(vm, 2);
} else if (be_isstring(vm, 2)) {
const char* s = be_tostring(vm, 2);
*i64 = atoll(s);
} else if (be_isbool(vm, 2)) {
*i64 = be_tobool(vm, 2) ? 1 : 0;
} else if (be_isinstance(vm, 2)) {
be_getglobal(vm, "int64");
if (be_isderived(vm, 2)) {
be_getmember(vm, 2, "_p");
int64_t *v64 = be_tocomptr(vm, -1);
if (v64 != NULL) {
*i64 = *v64;
}
} else {
invalid_arg = btrue;
}
} else {
invalid_arg = btrue;
}
}
if (invalid_arg) {
be_free(vm, i64, sizeof(int64_t));
be_raise(vm, "TypeError", "unsupported argument type");
}
be_pushcomptr(vm, i64);
be_setmember(vm, 1, "_p");
be_return_nil(vm);
} }
BE_FUNC_CTYPE_DECLARE(int64_init, "+_p", "@[i]")
void int64_deinit(bvm *vm, int64_t *i64) { /* destructor */
// serial_debug("int64_deinit p=%p\n", i64); static int int64_deinit(bvm *vm) {
be_getmember(vm, 1, "_p");
int64_t *i64 = be_tocomptr(vm, -1);
if (i64 != NULL) {
be_free(vm, i64, sizeof(int64_t)); be_free(vm, i64, sizeof(int64_t));
} }
BE_FUNC_CTYPE_DECLARE(int64_deinit, "", "@.") be_return_nil(vm);
}
char* int64_tostring(int64_t *i64) { char* int64_tostring(int64_t *i64) {
static char s[24]; /* enough to hold max value */ static char s[24]; /* enough to hold max value */
int64_toa(*i64, s); int64_toa(*i64, (uint8_t*)s);
return s; return s;
} }
BE_FUNC_CTYPE_DECLARE(int64_tostring, "s", ".") BE_FUNC_CTYPE_DECLARE(int64_tostring, "s", ".")
@ -80,6 +127,13 @@ int64_t* int64_fromu32(bvm *vm, uint32_t low, uint32_t high) {
} }
BE_FUNC_CTYPE_DECLARE(int64_fromu32, "int64", "@i[i]") BE_FUNC_CTYPE_DECLARE(int64_fromu32, "int64", "@i[i]")
int64_t* int64_fromfloat(bvm *vm, float f) {
int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t));
*r64 = (int64_t)f;
return r64;
}
BE_FUNC_CTYPE_DECLARE(int64_fromfloat, "int64", "@f")
int64_t* int64_add(bvm *vm, int64_t *i64, int64_t *j64) { int64_t* int64_add(bvm *vm, int64_t *i64, int64_t *j64) {
int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t));
// it's possible that arg j64 is nullptr, since class type does allow NULLPTR to come through. // it's possible that arg j64 is nullptr, since class type does allow NULLPTR to come through.
@ -203,7 +257,7 @@ int64_t* int64_frombytes(bvm *vm, uint8_t* ptr, size_t len, int32_t idx) {
int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t)); int64_t* r64 = (int64_t*)be_malloc(vm, sizeof(int64_t));
if (idx < 0) { idx = len + idx; } // support negative index, counting from the end if (idx < 0) { idx = len + idx; } // support negative index, counting from the end
if (idx < 0) { idx = 0; } // sanity check if (idx < 0) { idx = 0; } // sanity check
if (idx > len) { idx = len; } if (idx > (int32_t)len) { idx = len; }
uint32_t usable_len = len - idx; uint32_t usable_len = len - idx;
if (usable_len > sizeof(int64_t)) { usable_len = sizeof(int64_t); } if (usable_len > sizeof(int64_t)) { usable_len = sizeof(int64_t); }
*r64 = 0; // start with 0 *r64 = 0; // start with 0
@ -224,10 +278,9 @@ BE_FUNC_CTYPE_DECLARE(int64_high32, "i", "(int64)")
/* /*
def toint64(i) def toint64(v)
if (type(i) == 'int') return int64.fromu32(i) end if (v == nil) return nil end
if (type(i) == 'instance') && isinstance(i, int64) return i end return int64(v)
return nil
end end
*/ */
@ -237,7 +290,7 @@ end
********************************************************************/ ********************************************************************/
be_local_closure(toint64, /* name */ be_local_closure(toint64, /* name */
be_nested_proto( be_nested_proto(
4, /* nstack */ 3, /* nstack */
1, /* argc */ 1, /* argc */
0, /* varg */ 0, /* varg */
0, /* has upvals */ 0, /* has upvals */
@ -245,38 +298,21 @@ be_local_closure(toint64, /* name */
0, /* has sup protos */ 0, /* has sup protos */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
( &(const bvalue[ 4]) { /* constants */ ( &(const bvalue[ 1]) { /* constants */
/* K0 */ be_nested_str(int), /* K0 */ be_nested_str(int64),
/* K1 */ be_nested_str(int64),
/* K2 */ be_nested_str(fromu32),
/* K3 */ be_nested_str(instance),
}), }),
&be_const_str_to64, &be_const_str_toint64,
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[23]) { /* code */ ( &(const binstruction[ 9]) { /* code */
0x60040004, // 0000 GETGBL R1 G4 0x4C040000, // 0000 LDNIL R1
0x5C080000, // 0001 MOVE R2 R0 0x1C040001, // 0001 EQ R1 R0 R1
0x7C040200, // 0002 CALL R1 1 0x78060001, // 0002 JMPF R1 #0005
0x1C040300, // 0003 EQ R1 R1 K0 0x4C040000, // 0003 LDNIL R1
0x78060004, // 0004 JMPF R1 #000A 0x80040200, // 0004 RET 1 R1
0xB8060200, // 0005 GETNGBL R1 K1 0xB8060000, // 0005 GETNGBL R1 K0
0x8C040302, // 0006 GETMET R1 R1 K2 0x5C080000, // 0006 MOVE R2 R0
0x5C0C0000, // 0007 MOVE R3 R0 0x7C040200, // 0007 CALL R1 1
0x7C040400, // 0008 CALL R1 2 0x80040200, // 0008 RET 1 R1
0x80040200, // 0009 RET 1 R1
0x60040004, // 000A GETGBL R1 G4
0x5C080000, // 000B MOVE R2 R0
0x7C040200, // 000C CALL R1 1
0x1C040303, // 000D EQ R1 R1 K3
0x78060005, // 000E JMPF R1 #0015
0x6004000F, // 000F GETGBL R1 G15
0x5C080000, // 0010 MOVE R2 R0
0xB80E0200, // 0011 GETNGBL R3 K1
0x7C040400, // 0012 CALL R1 2
0x78060000, // 0013 JMPF R1 #0015
0x80040000, // 0014 RET 1 R0
0x4C040000, // 0015 LDNIL R1
0x80040200, // 0016 RET 1 R1
}) })
) )
); );
@ -288,9 +324,10 @@ be_local_closure(toint64, /* name */
/* @const_object_info_begin /* @const_object_info_begin
class be_class_int64 (scope: global, name: int64) { class be_class_int64 (scope: global, name: int64) {
_p, var _p, var
init, ctype_func(int64_init) init, func(int64_init)
deinit, ctype_func(int64_deinit) deinit, func(int64_deinit)
fromu32, static_ctype_func(int64_fromu32) fromu32, static_ctype_func(int64_fromu32)
fromfloat, static_ctype_func(int64_fromfloat)
toint64, static_closure(toint64_closure) toint64, static_closure(toint64_closure)
tostring, ctype_func(int64_tostring) tostring, ctype_func(int64_tostring)

View File

@ -7,6 +7,18 @@ assert(str(int64(10)) == "10")
assert(int(int64(-5)) == -5) assert(int(int64(-5)) == -5)
assert(str(int64(-5)) == "-5") assert(str(int64(-5)) == "-5")
# extended constructor
assert(int64(35).tostring() == "35")
assert(int64(3.5).tostring() == "3")
assert(int64("35").tostring() == "35")
assert(int64("20000000000").tostring() == "20000000000")
assert(int64(true).tostring() == "1")
assert(int64(false).tostring() == "0")
assert(int64(int64(42)).tostring() == "42")
# invalid
assert(int64("").tostring() == "0")
assert(int64(nil).tostring() == "0")
# testing large numbers # testing large numbers
assert(str(int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF)) == "9223372036854775807") # max positive number assert(str(int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF)) == "9223372036854775807") # max positive number
assert(str(int64.fromu32(0x00000000, 0x80000000)) == "-9223372036854775808") assert(str(int64.fromu32(0x00000000, 0x80000000)) == "-9223372036854775808")
@ -83,10 +95,9 @@ assert((int64(10) <= 0) == false)
# tobytes # tobytes
assert(int64().tobytes() == bytes("0000000000000000")) assert(int64().tobytes() == bytes("0000000000000000"))
assert(int64(10).tobytes() == bytes("0A00000000000000")) assert(int64(10).tobytes() == bytes("0A00000000000000"))
a = int64() a = int64.fromu32(0xFFFFFFFF, 0x7FFFFFFF) # max positive number
a.set(0x7FFFFFFF,0xFFFFFFFF) # max positive number
assert(a.tobytes() == bytes("FFFFFFFFFFFFFF7F")) assert(a.tobytes() == bytes("FFFFFFFFFFFFFF7F"))
a.set(0x80000000,0x00000000) a = int64.fromu32(0x00000000, 0x80000000)
assert(a.tobytes() == bytes("0000000000000080")) assert(a.tobytes() == bytes("0000000000000080"))
assert(int64(-1).tobytes() == bytes("FFFFFFFFFFFFFFFF")) assert(int64(-1).tobytes() == bytes("FFFFFFFFFFFFFFFF"))
@ -106,3 +117,20 @@ assert(int64.fromu32(0xFFFFFFFF).tobytes() == bytes("FFFFFFFF00000000"))
assert(int64.fromu32(0xFFFFFFFF, 1).tobytes() == bytes("FFFFFFFF01000000")) assert(int64.fromu32(0xFFFFFFFF, 1).tobytes() == bytes("FFFFFFFF01000000"))
assert(int64.fromu32(-1, 1).tobytes() == bytes("FFFFFFFF01000000")) assert(int64.fromu32(-1, 1).tobytes() == bytes("FFFFFFFF01000000"))
assert(int64.fromu32(-1, -1).tobytes() == bytes("FFFFFFFFFFFFFFFF")) assert(int64.fromu32(-1, -1).tobytes() == bytes("FFFFFFFFFFFFFFFF"))
# fromfloat
assert(int64.fromfloat(3.5).tostring() == "3")
assert(int64.fromfloat(-3.5).tostring() == "-3")
assert(int64.fromfloat(2e10).tostring() == "20000000000") # 20000000000 does not fit in 32 bits
# toint64, supports int, float, bool, string, int64
assert(int64.toint64(35).tostring() == "35")
assert(int64.toint64(3.5).tostring() == "3")
assert(int64.toint64("35").tostring() == "35")
assert(int64.toint64("20000000000").tostring() == "20000000000")
assert(int64.toint64(true).tostring() == "1")
assert(int64.toint64(false).tostring() == "0")
assert(int64.toint64(int64(42)).tostring() == "42")
# invalid
assert(int64.toint64("").tostring() == "0")
assert(int64.toint64(nil) == nil)

View File

@ -34,15 +34,15 @@ typedef intptr_t (*fn_any_callable)(intptr_t p0, intptr_t p1, intptr_t p2, intpt
* On ESP32, int=32bits, real=float (32bits) * On ESP32, int=32bits, real=float (32bits)
\*********************************************************************************************/ \*********************************************************************************************/
static intptr_t realasint(breal v) { static intptr_t realasint(breal v) {
intptr_t i; union { breal f; bint i; } u;
i = *((intptr_t*) &v); u.f = v;
return i; return (intptr_t)u.i;
} }
static breal intasreal(intptr_t v) { static breal intasreal(intptr_t v) {
breal r; union { breal f; bint i; } u;
r = *((breal*) &v); u.i = (bint)v;
return r; return (breal)u.f;
} }
/*********************************************************************************************\ /*********************************************************************************************\

View File

@ -233,6 +233,7 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
#include "solidify/solidified_Matter_Plugin_0.h" #include "solidify/solidified_Matter_Plugin_0.h"
#include "solidify/solidified_Matter_z_Commissioning.h" #include "solidify/solidified_Matter_z_Commissioning.h"
#include "solidify/solidified_Matter_z_Autoconf.h" #include "solidify/solidified_Matter_z_Autoconf.h"
#include "solidify/solidified_Matter_z_Zigbee.h"
#include "solidify/solidified_Matter_Base38.h" #include "solidify/solidified_Matter_Base38.h"
#include "solidify/solidified_Matter_UI.h" #include "solidify/solidified_Matter_UI.h"
#include "solidify/solidified_Matter_Profiler.h" #include "solidify/solidified_Matter_Profiler.h"
@ -295,6 +296,13 @@ extern const bclass be_class_Matter_TLV; // need to declare it upfront because
#include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Air_Quality.h" #include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Air_Quality.h"
#include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Rain.h" #include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Rain.h"
#include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Waterleak.h" #include "solidify/solidified_Matter_Plugin_8_Bridge_Sensor_Waterleak.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Light0.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Light1.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Light2.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Temperature.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Pressure.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Humidity.h"
#include "solidify/solidified_Matter_Plugin_9_Zigbee_Occupancy.h"
#include "solidify/solidified_Matter_Plugin_z_All.h" #include "solidify/solidified_Matter_Plugin_z_All.h"
#include "solidify/solidified_Matter_zz_Device.h" #include "solidify/solidified_Matter_zz_Device.h"

View File

@ -735,7 +735,7 @@ class Matter_IM
var ep_str = (q.endpoint != nil) ? f"{q.endpoint:02X}" : "**" var ep_str = (q.endpoint != nil) ? f"{q.endpoint:02X}" : "**"
var cl_str = (q.cluster != nil) ? f"{q.cluster:04X}" : "****" var cl_str = (q.cluster != nil) ? f"{q.cluster:04X}" : "****"
var ev_str = (q.event != nil) ? f"{q.event:02X}" : "**" var ev_str = (q.event != nil) ? f"{q.event:02X}" : "**"
var event_no_min_str = (event_no_min != nil) ? f" (>{event_no_min})" : "" var event_no_min_str = (event_no_min != nil) ? f" (event>{event_no_min})" : ""
log(f"MTR: >Read_Event({msg.session.local_session_id:6i}) [{ep_str}]{cl_str}/{ev_str} {event_name}{event_no_min_str}", 3) log(f"MTR: >Read_Event({msg.session.local_session_id:6i}) [{ep_str}]{cl_str}/{ev_str} {event_name}{event_no_min_str}", 3)
end end
end end

View File

@ -35,6 +35,7 @@ class Matter_Plugin
static var UPDATE_TIME = 5000 # default is every 5 seconds static var UPDATE_TIME = 5000 # default is every 5 seconds
static var VIRTUAL = false # set to true only for virtual devices static var VIRTUAL = false # set to true only for virtual devices
static var BRIDGE = false # set to true only for bridged devices (ESP8266 or OpenBK) static var BRIDGE = false # set to true only for bridged devices (ESP8266 or OpenBK)
static var ZIGBEE = false # set to true only when mapped to a zigbee device
var update_next # next timestamp for update var update_next # next timestamp for update
# Configuration of the plugin: clusters and type # Configuration of the plugin: clusters and type
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
@ -258,6 +259,13 @@ matter_device.events.dump()
# #
# we limit to 3 commands (to we need more?) # we limit to 3 commands (to we need more?)
def publish_command(key1, value1, key2, value2, key3, value3) def publish_command(key1, value1, key2, value2, key3, value3)
# if zigbee, decompose simple commands
if self.ZIGBEE && self.zigbee_mapper && self.zigbee_mapper.resolve_zb_device()
self.zigbee_mapper.zb_single_command(key1, value1)
self.zigbee_mapper.zb_single_command(key2, value2)
self.zigbee_mapper.zb_single_command(key3, value3)
end
import json import json
var payload = f"{json.dump(key1)}:{json.dump(value1)}" var payload = f"{json.dump(key1)}:{json.dump(value1)}"
if key2 != nil if key2 != nil
@ -536,7 +544,7 @@ matter_device.events.dump()
# key: key name in the JSON payload to read from, do nothing if key does not exist or content is `null` # key: key name in the JSON payload to read from, do nothing if key does not exist or content is `null`
# old_val: previous value, used to detect a change or return the value unchanged # old_val: previous value, used to detect a change or return the value unchanged
# type_func: type enforcer for value, typically `int`, `bool`, `str`, `number`, `real` # type_func: type enforcer for value, typically `int`, `bool`, `str`, `number`, `real`
# cluster/attribute: in case the value has change, publish a change to cluster/attribute # cluster/attribute: in case the value has change, publish a change to cluster/attribute. Don't publish if they are `nil`
# #
# Returns: # Returns:
# `old_val` if key does not exist, JSON value is `null`, or value is unchanged # `old_val` if key does not exist, JSON value is `null`, or value is unchanged
@ -546,7 +554,7 @@ matter_device.events.dump()
var val = payload.find(key) var val = payload.find(key)
if (val != nil) if (val != nil)
val = type_func(val) val = type_func(val)
if (val != old_val) if (val != old_val) && (cluster != nil) && (attribute != nil)
self.attribute_updated(cluster, attribute) self.attribute_updated(cluster, attribute)
end end
return val return val

View File

@ -55,6 +55,12 @@ class Matter_Plugin_Device : Matter_Plugin
############################################################# #############################################################
# Constructor # Constructor
def init(device, endpoint, arguments) def init(device, endpoint, arguments)
# Zigbee code, activated only when `ZIGBEE` is true
# attribute `zigbee_mapper` needs to be defined for classes with `ZIGBEE` true
if self.ZIGBEE
self.zigbee_mapper = device.create_zb_mapper(self) # needs to exist before `parse_configuration()` is called
end
super(self).init(device, endpoint, arguments) super(self).init(device, endpoint, arguments)
if self.BRIDGE if self.BRIDGE
@ -64,6 +70,35 @@ class Matter_Plugin_Device : Matter_Plugin
end end
end end
#############################################################
# parse_configuration
#
# Parse configuration map, handling case of Zigbee configuration
def parse_configuration(config)
# super(self).parse_configuration(config) # not necessary because the superclass does nothing
if self.ZIGBEE && self.zigbee_mapper
self.zigbee_mapper.parse_configuration(config)
end
end
#############################################################
# Called when the value changed compared to shadow value
#
# This must be overriden.
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
def value_changed()
# self.attribute_updated(0x0402, 0x0000)
end
#############################################################
# Pre-process value
#
# This must be overriden.
# This allows to convert the raw sensor value to the target one, typically int
def pre_value(val)
return val
end
############################################################# #############################################################
# read an attribute # read an attribute
# #
@ -438,5 +473,31 @@ class Matter_Plugin_Device : Matter_Plugin
return old_val return old_val
end end
#############################################################
# For Zigbee devices
#############################################################
#############################################################
# attributes_refined
#
# Filtered to only events for this endpoint
#
# Can be called only if `self.ZIGBEE` is true
def zigbee_received(frame, attr_list)
import math
log(f"MTR: zigbee_received Ox{self.zigbee_mapper.shortaddr:04X} {attr_list=} {type(attr_list)=}", 3)
var idx = 0
while (idx < size(attr_list))
var entry = attr_list[idx]
if (entry.key == self.ZIGBEE_NAME)
var val = self.pre_value(entry.val)
var update_list = { self.JSON_NAME : val } # Matter temperature is 1/100th of degrees
self.update_virtual(update_list)
log(f"MTR: [{self.endpoint:02X}] {self.JSON_NAME} updated {update_list}", 3)
return nil
end
idx += 1
end
end
end end
matter.Plugin_Device = Matter_Plugin_Device matter.Plugin_Device = Matter_Plugin_Device

View File

@ -25,7 +25,7 @@ import matter
class Matter_Plugin_Light0 : Matter_Plugin_Device class Matter_Plugin_Light0 : Matter_Plugin_Device
static var TYPE = "light0" # name of the plug-in in json static var TYPE = "light0" # name of the plug-in in json
static var DISPLAY_NAME = "Light 0 On" # display name of the plug-in static var DISPLAY_NAME = "Light 0 OnOff" # display name of the plug-in
static var ARG = "relay" # additional argument name (or empty if none) static var ARG = "relay" # additional argument name (or empty if none)
static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
static var ARG_HINT = "Relay<x> number" static var ARG_HINT = "Relay<x> number"
@ -63,6 +63,7 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
# with Light0 we always need relay number but we don't for Light1/2/3 so self.tasmota_relay_index may be `nil` # with Light0 we always need relay number but we don't for Light1/2/3 so self.tasmota_relay_index may be `nil`
self.tasmota_relay_index = int(config.find(self.ARG #-'relay'-#, nil)) self.tasmota_relay_index = int(config.find(self.ARG #-'relay'-#, nil))
if (self.tasmota_relay_index != nil && self.tasmota_relay_index <= 0) self.tasmota_relay_index = 1 end if (self.tasmota_relay_index != nil && self.tasmota_relay_index <= 0) self.tasmota_relay_index = 1 end
@ -174,6 +175,40 @@ class Matter_Plugin_Light0 : Matter_Plugin_Device
super(self).update_virtual(payload) super(self).update_virtual(payload)
end end
#############################################################
# For Zigbee devices
#############################################################
#############################################################
# attributes_refined
#
# Filtered to only events for this endpoint
# Contains common code for Light 0/1/2/3 to avoid code duplication
#
# Can be called only if `self.ZIGBEE` is true
def zigbee_received(frame, attr_list)
import math
log(f"MTR: zigbee_received Ox{self.zigbee_mapper.shortaddr:04X} {attr_list=} {type(attr_list)=}", 3)
var idx = 0
var update_list = {}
while (idx < size(attr_list))
var entry = attr_list[idx]
if (entry.key == "Power")
update_list['Power'] = int(entry.val)
end
if (entry.key == "Dimmer")
update_list['Dimmer'] = int(entry.val)
end
if (entry.key == "CT")
update_list['CT'] = int(entry.val)
end
idx += 1
end
if (size(update_list) > 0)
self.update_virtual(update_list)
log(f"MTR: [{self.endpoint:02X}] Light2 updated {update_list}", 3)
end
end
############################################################# #############################################################
# For Bridge devices # For Bridge devices
############################################################# #############################################################

View File

@ -57,6 +57,7 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
self.tasmota_sensor_filter = config.find(self.ARG#-'filter'-#) self.tasmota_sensor_filter = config.find(self.ARG#-'filter'-#)
if self.tasmota_sensor_filter if self.tasmota_sensor_filter
self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(self.tasmota_sensor_filter) self.tasmota_sensor_matcher = tasmota.Rule_Matcher.parse(self.tasmota_sensor_filter)
@ -84,24 +85,6 @@ class Matter_Plugin_Sensor : Matter_Plugin_Device
end end
end end
#############################################################
# Called when the value changed compared to shadow value
#
# This must be overriden.
# This is where you call `self.attribute_updated(<cluster>, <attribute>)`
def value_changed()
# self.attribute_updated(0x0402, 0x0000)
end
#############################################################
# Pre-process value
#
# This must be overriden.
# This allows to convert the raw sensor value to the target one, typically int
def pre_value(val)
return val
end
############################################################# #############################################################
# update_virtual # update_virtual
# #

View File

@ -77,6 +77,7 @@ class Matter_Plugin_Sensor_Air_Quality : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
self.prefix = str(config.find(self.ARG)) self.prefix = str(config.find(self.ARG))
end end

View File

@ -46,6 +46,7 @@ class Matter_Plugin_Sensor_Boolean : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
self.tasmota_switch_index = int(config.find(self.ARG #-'switch'-#, 1)) self.tasmota_switch_index = int(config.find(self.ARG #-'switch'-#, 1))
if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end
end end
@ -79,6 +80,16 @@ class Matter_Plugin_Sensor_Boolean : Matter_Plugin_Device
def value_updated() def value_updated()
end end
#############################################################
# update_virtual
#
# Update internal state for virtual devices
def update_virtual(payload)
self.shadow_bool_value = self._parse_update_virtual(payload, self.JSON_NAME, self.shadow_bool_value, bool, nil, nil) # publishing cluster/attr is delegated to `value_updated()`
self.value_updated()
super(self).update_virtual(payload)
end
############################################################# #############################################################
# For Bridge devices # For Bridge devices
############################################################# #############################################################

View File

@ -46,6 +46,7 @@ class Matter_Plugin_Sensor_GenericSwitch_Btn : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
self.tasmota_switch_index = int(config.find(self.ARG #-'relay'-#, 1)) self.tasmota_switch_index = int(config.find(self.ARG #-'relay'-#, 1))
if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end if self.tasmota_switch_index <= 0 self.tasmota_switch_index = 1 end
end end

View File

@ -49,6 +49,7 @@ class Matter_Plugin_Shutter : Matter_Plugin_Device
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
self.tasmota_shutter_index = config.find(self.ARG #-'relay'-#) self.tasmota_shutter_index = config.find(self.ARG #-'relay'-#)
if self.tasmota_shutter_index == nil self.tasmota_shutter_index = 0 end if self.tasmota_shutter_index == nil self.tasmota_shutter_index = 0 end
self.shadow_shutter_inverted = -1 self.shadow_shutter_inverted = -1
@ -110,22 +111,29 @@ class Matter_Plugin_Shutter : Matter_Plugin_Device
elif attribute == 0x000D # ---------- EndProductType / u8 ---------- elif attribute == 0x000D # ---------- EndProductType / u8 ----------
return tlv_solo.set(TLV.U1, 0xFF) # 0xFF = unknown type of shutter return tlv_solo.set(TLV.U1, 0xFF) # 0xFF = unknown type of shutter
elif attribute == 0x000E # ---------- CurrentPositionLiftPercent100ths / u16 ---------- elif attribute == 0x000E # ---------- CurrentPositionLiftPercent100ths / u16 ----------
if self.shadow_shutter_pos != nil
if self.shadow_shutter_inverted == 0 if self.shadow_shutter_inverted == 0
matter_position = (100 - self.shadow_shutter_pos) * 100 matter_position = (100 - self.shadow_shutter_pos) * 100
else else
matter_position = self.shadow_shutter_pos * 100 matter_position = self.shadow_shutter_pos * 100
end end
return tlv_solo.set(TLV.U2, matter_position) end
return tlv_solo.set_or_nil(TLV.U2, matter_position)
elif attribute == 0x000A # ---------- OperationalStatus / u8 ---------- elif attribute == 0x000A # ---------- OperationalStatus / u8 ----------
var op = self.shadow_shutter_direction == 0 ? 0 : (self.shadow_shutter_direction > 0 ? 1 : 2) var op
return tlv_solo.set(TLV.U1, op) if self.shadow_shutter_direction != nil
op = self.shadow_shutter_direction == 0 ? 0 : (self.shadow_shutter_direction > 0 ? 1 : 2)
end
return tlv_solo.set_or_nil(TLV.U1, op)
elif attribute == 0x000B # ---------- TargetPositionLiftPercent100ths / u16 ---------- elif attribute == 0x000B # ---------- TargetPositionLiftPercent100ths / u16 ----------
if self.shadow_shutter_target != nil
if self.shadow_shutter_inverted == 0 if self.shadow_shutter_inverted == 0
matter_position = (100 - self.shadow_shutter_target) * 100 matter_position = (100 - self.shadow_shutter_target) * 100
else else
matter_position = self.shadow_shutter_target * 100 matter_position = self.shadow_shutter_target * 100
end end
return tlv_solo.set(TLV.U2, matter_position) end
return tlv_solo.set_or_nil(TLV.U2, matter_position)
elif attribute == 0x0017 # ---------- Mode / u8 ---------- elif attribute == 0x0017 # ---------- Mode / u8 ----------
return tlv_solo.set(TLV.U1, 0) # normal mode return tlv_solo.set(TLV.U1, 0) # normal mode

View File

@ -63,6 +63,7 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0
# #
# Parse configuration map # Parse configuration map
def parse_configuration(config) def parse_configuration(config)
super(self).parse_configuration(config)
# with Light0 we always need relay number but we don't for Light1/2/3 so self.tasmota_relay_index may be `nil` # with Light0 we always need relay number but we don't for Light1/2/3 so self.tasmota_relay_index may be `nil`
if self.BRIDGE if self.BRIDGE
self.tasmota_relay_index = int(config.find(self.ARG #-'relay'-#, nil)) self.tasmota_relay_index = int(config.find(self.ARG #-'relay'-#, nil))
@ -207,7 +208,7 @@ class Matter_Plugin_Light1 : Matter_Plugin_Light0
var onoff = bri_254 > 0 var onoff = bri_254 > 0
self.set_bri(bri_254, onoff) self.set_bri(bri_254, onoff)
ctx.log = "bri:"+str(bri_254) ctx.log = "bri:"+str(bri_254)
self.publish_command('Bri', bri_254, 'Dimmer', tasmota.scale_uint(bri_254, 0, 254, 0, 100), 'Power', onoff ? 1 : 0) self.publish_command('Power', onoff ? 1 : 0, 'Bri', bri_254, 'Dimmer', tasmota.scale_uint(bri_254, 0, 254, 0, 100))
return true return true
elif command == 0x0005 # ---------- MoveWithOnOff ---------- elif command == 0x0005 # ---------- MoveWithOnOff ----------
# TODO, we don't really support it # TODO, we don't really support it

View File

@ -30,6 +30,7 @@ class Matter_Plugin_Sensor_Contact : Matter_Plugin_Sensor_Boolean
# static var ARG_HINT = "Switch<x> number" # static var ARG_HINT = "Switch<x> number"
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type # static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 750 # update every 750ms # static var UPDATE_TIME = 750 # update every 750ms
static var JSON_NAME = "Contact" # Name of the sensor attribute in JSON payloads
static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Contact") static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Contact")
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0045: [0], # Boolean State p.70 - no writable 0x0045: [0], # Boolean State p.70 - no writable
@ -66,15 +67,6 @@ class Matter_Plugin_Sensor_Contact : Matter_Plugin_Sensor_Boolean
return super(self).read_attribute(session, ctx, tlv_solo) return super(self).read_attribute(session, ctx, tlv_solo)
end end
#############################################################
# update_virtual
#
# Update internal state for virtual devices
def update_virtual(payload)
self.shadow_bool_value = self._parse_update_virtual(payload, "Contact", self.shadow_bool_value, bool, 0x0045, 0x0000)
super(self).update_virtual(payload)
end
############################################################# #############################################################
# For Bridge devices # For Bridge devices
############################################################# #############################################################

View File

@ -30,6 +30,7 @@ class Matter_Plugin_Sensor_Occupancy : Matter_Plugin_Sensor_Boolean
# static var ARG_HINT = "Switch<x> number" # static var ARG_HINT = "Switch<x> number"
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type # static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 750 # update every 750ms # static var UPDATE_TIME = 750 # update every 750ms
static var JSON_NAME = "Occupancy" # Name of the sensor attribute in JSON payloads
static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Occupancy") static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Occupancy")
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0406: [0,1,2], # Occupancy Sensing p.105 - no writable 0x0406: [0,1,2], # Occupancy Sensing p.105 - no writable
@ -70,15 +71,6 @@ class Matter_Plugin_Sensor_Occupancy : Matter_Plugin_Sensor_Boolean
return super(self).read_attribute(session, ctx, tlv_solo) return super(self).read_attribute(session, ctx, tlv_solo)
end end
#############################################################
# update_virtual
#
# Update internal state for virtual devices
def update_virtual(payload)
self.shadow_bool_value = self._parse_update_virtual(payload, "Occupancy", self.shadow_bool_value, bool, 0x0406, 0x0000)
super(self).update_virtual(payload)
end
############################################################# #############################################################
# For Bridge devices # For Bridge devices
############################################################# #############################################################

View File

@ -28,6 +28,8 @@ class Matter_Plugin_Sensor_OnOff : Matter_Plugin_Sensor_Boolean
# static var ARG_HINT = "Switch<x> number" # static var ARG_HINT = "Switch<x> number"
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type # static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 750 # update every 750ms # static var UPDATE_TIME = 750 # update every 750ms
static var JSON_NAME = "OnOff" # Name of the sensor attribute in JSON payloads
static var UPDATE_COMMANDS = matter.UC_LIST(_class, "OnOff")
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0006: [0], # On/Off 1.5 p.48 0x0006: [0], # On/Off 1.5 p.48
}) })

View File

@ -30,6 +30,7 @@ class Matter_Plugin_Sensor_Rain : Matter_Plugin_Sensor_Boolean
# static var ARG_HINT = "Switch<x> number" # static var ARG_HINT = "Switch<x> number"
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type # static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 750 # update every 750ms # static var UPDATE_TIME = 750 # update every 750ms
static var JSON_NAME = "Rain" # Name of the sensor attribute in JSON payloads
static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Rain") static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Rain")
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0045: [0], # Boolean State p.70 - no writable 0x0045: [0], # Boolean State p.70 - no writable
@ -67,15 +68,6 @@ class Matter_Plugin_Sensor_Rain : Matter_Plugin_Sensor_Boolean
return super(self).read_attribute(session, ctx, tlv_solo) return super(self).read_attribute(session, ctx, tlv_solo)
end end
#############################################################
# update_virtual
#
# Update internal state for virtual devices
def update_virtual(payload)
self.shadow_bool_value = self._parse_update_virtual(payload, "Rain", self.shadow_bool_value, bool, 0x0045, 0x0000)
super(self).update_virtual(payload)
end
############################################################# #############################################################
# For Bridge devices # For Bridge devices
############################################################# #############################################################

View File

@ -30,6 +30,7 @@ class Matter_Plugin_Sensor_Waterleak : Matter_Plugin_Sensor_Boolean
# static var ARG_HINT = "Switch<x> number" # static var ARG_HINT = "Switch<x> number"
# static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type # static var ARG_TYPE = / x -> int(x) # function to convert argument to the right type
# static var UPDATE_TIME = 750 # update every 750ms # static var UPDATE_TIME = 750 # update every 750ms
static var JSON_NAME = "Waterleak" # Name of the sensor attribute in JSON payloads
static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Waterleak") static var UPDATE_COMMANDS = matter.UC_LIST(_class, "Waterleak")
static var CLUSTERS = matter.consolidate_clusters(_class, { static var CLUSTERS = matter.consolidate_clusters(_class, {
0x0045: [0], # Boolean State p.70 - no writable 0x0045: [0], # Boolean State p.70 - no writable
@ -45,20 +46,26 @@ class Matter_Plugin_Sensor_Waterleak : Matter_Plugin_Sensor_Boolean
# #
# This is triggered when a new value is changed, for subscription # This is triggered when a new value is changed, for subscription
# This method is meant to be overloaded and maximize shared code # This method is meant to be overloaded and maximize shared code
def value_updated = Matter_Plugin_Sensor_Rain.value_updated def value_updated()
self.attribute_updated(0x0045, 0x0000)
end
############################################################# #############################################################
# read an attribute # read an attribute
# #
def read_attribute = Matter_Plugin_Sensor_Rain.read_attribute def read_attribute(session, ctx, tlv_solo)
var TLV = matter.TLV
var cluster = ctx.cluster
var attribute = ctx.attribute
############################################################# # ====================================================================================================
# update_virtual if cluster == 0x0045 # ========== Boolean State ==========
# if attribute == 0x0000 # ---------- StateValue / bool ----------
# Update internal state for virtual devices return tlv_solo.set(TLV.BOOL, self.shadow_bool_value)
def update_virtual(payload) end
self.shadow_bool_value = self._parse_update_virtual(payload, "Waterleak", self.shadow_bool_value, bool, 0x0045, 0x0000)
super(self).update_virtual(payload) end
return super(self).read_attribute(session, ctx, tlv_solo)
end end
############################################################# #############################################################

View File

@ -26,7 +26,7 @@ import matter
class Matter_Plugin_Bridge_Light0 : Matter_Plugin_Light0 class Matter_Plugin_Bridge_Light0 : Matter_Plugin_Light0
static var BRIDGE = true # flag as bridged device static var BRIDGE = true # flag as bridged device
static var TYPE = "http_light0" # name of the plug-in in json static var TYPE = "http_light0" # name of the plug-in in json
# static var DISPLAY_NAME = "Light 0 On" # display name of the plug-in # static var DISPLAY_NAME = "Light 0 OnOff" # display name of the plug-in
static var UPDATE_TIME = 3000 # update every 3s static var UPDATE_TIME = 3000 # update every 3s
end end
matter.Plugin_Bridge_Light0 = Matter_Plugin_Bridge_Light0 matter.Plugin_Bridge_Light0 = Matter_Plugin_Bridge_Light0

View File

@ -25,7 +25,7 @@ import matter
class Matter_Plugin_Virt_Light0 : Matter_Plugin_Light0 class Matter_Plugin_Virt_Light0 : Matter_Plugin_Light0
static var TYPE = "v_light0" # name of the plug-in in json static var TYPE = "v_light0" # name of the plug-in in json
static var DISPLAY_NAME = "v.Light 0 On" # display name of the plug-in static var DISPLAY_NAME = "v.Light 0 OnOff" # display name of the plug-in
static var ARG = "" # no arg for virtual device static var ARG = "" # no arg for virtual device
static var ARG_HINT = "_Not used_" # Hint for entering the Argument (inside 'placeholder') static var ARG_HINT = "_Not used_" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device static var VIRTUAL = true # virtual device

View File

@ -0,0 +1,38 @@
#
# Matter_Plugin_9_Zigbee_Humidity.be - implements the behavior for a Zigbee Humidity sensor
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Humidity,weak
class Matter_Plugin_Zigbee_Humidity : Matter_Plugin_Sensor_Humidity
static var ZIGBEE = true
static var TYPE = "z_humidity" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Humidity" # display name of the plug-in
static var ZIGBEE_NAME = "Humidity" # name of zigbee attribute with sensor reported
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Humidity = Matter_Plugin_Zigbee_Humidity

View File

@ -0,0 +1,38 @@
#
# Matter_Plugin_9_Zigbee_Temperature.be - implements the behavior for a Zigbee Light0
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Light0,weak
class Matter_Plugin_Zigbee_Light0 : Matter_Plugin_Light0
static var ZIGBEE = true
static var TYPE = "z_light0" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Light 0 OnOff" # display name of the plug-in
static var ZIGBEE_NAME = "Power" # name of zigbee attribute with sensor reported
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Light0 = Matter_Plugin_Zigbee_Light0

View File

@ -0,0 +1,37 @@
#
# Matter_Plugin_9_Zigbee_Temperature.be - implements the behavior for a Zigbee Light1
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Light1,weak
class Matter_Plugin_Zigbee_Light1 : Matter_Plugin_Light1
static var ZIGBEE = true
static var TYPE = "z_light1" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Light 1 Dimmer" # display name of the plug-in
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Light1 = Matter_Plugin_Zigbee_Light1

View File

@ -0,0 +1,37 @@
#
# Matter_Plugin_9_Zigbee_Temperature.be - implements the behavior for a Zigbee Light2
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Light2,weak
class Matter_Plugin_Zigbee_Light2 : Matter_Plugin_Light2
static var ZIGBEE = true
static var TYPE = "z_light2" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Light 2 CT" # display name of the plug-in
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Light2 = Matter_Plugin_Zigbee_Light2

View File

@ -0,0 +1,38 @@
#
# Matter_Plugin_9_Zigbee_Occupancy.be - implements the behavior for a Zigbee Occupancy sensor
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Occupancy,weak
class Matter_Plugin_Zigbee_Occupancy : Matter_Plugin_Sensor_Occupancy
static var ZIGBEE = true
static var TYPE = "z_occupancy" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Occupancy" # display name of the plug-in
static var ZIGBEE_NAME = "Occupancy" # name of zigbee attribute with sensor reported
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Occupancy = Matter_Plugin_Zigbee_Occupancy

View File

@ -0,0 +1,38 @@
#
# Matter_Plugin_9_Zigbee_Pressure.be - implements the behavior for a Zigbee Pressure sensor
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Pressure,weak
class Matter_Plugin_Zigbee_Pressure : Matter_Plugin_Sensor_Pressure
static var ZIGBEE = true
static var TYPE = "z_pressure" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Pressure" # display name of the plug-in
static var ZIGBEE_NAME = "Pressure" # name of zigbee attribute with sensor reported
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Pressure = Matter_Plugin_Zigbee_Pressure

View File

@ -0,0 +1,38 @@
#
# Matter_Plugin_9_Zigbee_Temperature.be - implements the behavior for a Zigbee Temperature sensor
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# Matter plug-in for core behavior
#@ solidify:Matter_Plugin_Zigbee_Temperature,weak
class Matter_Plugin_Zigbee_Temperature : Matter_Plugin_Sensor_Temp
static var ZIGBEE = true
static var TYPE = "z_temp" # name of the plug-in in json
static var DISPLAY_NAME = "Zig Temperature" # display name of the plug-in
static var ZIGBEE_NAME = "Temperature" # name of zigbee attribute with sensor reported
static var ARG = "zigbee_device" # zigbee device
static var ARG_TYPE = / x -> str(x) # function to convert argument to the right type
static var ARG_HINT = "Device" # Hint for entering the Argument (inside 'placeholder')
static var VIRTUAL = true # virtual device, necessary for Zigbee mapping
var zigbee_mapper # required for zigbee device
end
matter.Plugin_Zigbee_Temperature = Matter_Plugin_Zigbee_Temperature

View File

@ -32,11 +32,13 @@ import matter
# WebUI for the partition manager # WebUI for the partition manager
################################################################################# #################################################################################
class Matter_UI class Matter_UI
static var _CLASSES_TYPES = "|relay|light0|light1|light2|light3|shutter|shutter+tilt" static var _CLASSES_TYPES_STD =
"|relay|light0|light1|light2|light3|shutter|shutter+tilt"
"|gensw_btn" "|gensw_btn"
"|temperature|pressure|illuminance|humidity|occupancy|onoff|contact|flow|rain|waterleak" "|temperature|pressure|illuminance|humidity|occupancy|onoff|contact|flow|rain|waterleak"
"|airquality" "|airquality"
"|-virtual|v_relay|v_light0|v_light1|v_light2|v_light3" static var _CLASSES_TYPES_VIRTUAL =
"-virtual|v_relay|v_light0|v_light1|v_light2|v_light3"
"|v_fan" "|v_fan"
"|v_temp|v_pressure|v_illuminance|v_humidity|v_occupancy|v_contact|v_flow|v_rain|v_waterleak" "|v_temp|v_pressure|v_illuminance|v_humidity|v_occupancy|v_contact|v_flow|v_rain|v_waterleak"
"|v_airquality" "|v_airquality"
@ -45,6 +47,7 @@ class Matter_UI
"|http_occupancy|http_contact|http_flow|http_rain|http_waterleak" "|http_occupancy|http_contact|http_flow|http_rain|http_waterleak"
"|http_airquality" "|http_airquality"
var device var device
var matter_enabled
# #################################################################################################### # ####################################################################################################
# Static function to compare two maps (shallow compare) # Static function to compare two maps (shallow compare)
@ -64,8 +67,9 @@ class Matter_UI
# #################################################################################################### # ####################################################################################################
# Constructor # Constructor
def init(device) def init(device, matter_enabled)
self.device = device self.device = device
self.matter_enabled = matter_enabled
tasmota.add_driver(self) tasmota.add_driver(self)
end end
@ -81,13 +85,6 @@ class Matter_UI
webserver.content_send(" Configure Matter</button></form></p>") webserver.content_send(" Configure Matter</button></form></p>")
end end
#- ---------------------------------------------------------------------- -#
#- Is Matter enabled?
#- ---------------------------------------------------------------------- -#
def matter_enabled()
return bool(tasmota.get_option(matter.MATTER_OPTION))
end
#- ---------------------------------------------------------------------- -# #- ---------------------------------------------------------------------- -#
#- Show commissioning information and QR Code #- Show commissioning information and QR Code
# #
@ -102,11 +99,11 @@ class Matter_UI
"<form action='/matterc' method='post'>") "<form action='/matterc' method='post'>")
# checkbox for Matter enable # checkbox for Matter enable
var matter_enabled_checked = self.matter_enabled() ? 'checked' : '' var matter_enabled_checked = matter_enabled ? 'checked' : ''
webserver.content_send(f"<p><input id='menable' type='checkbox' name='menable' {matter_enabled_checked}>") webserver.content_send(f"<p><input id='menable' type='checkbox' name='menable' {matter_enabled_checked}>")
webserver.content_send("<label for='menable'><b>Matter enable</b></label></p>") webserver.content_send("<label for='menable'><b>Matter enable</b></label></p>")
if self.matter_enabled() if matter_enabled
# checkbox for Matter commissioning # checkbox for Matter commissioning
var commissioning_open_checked = self.device.commissioning.commissioning_open != nil ? "checked" : "" var commissioning_open_checked = self.device.commissioning.commissioning_open != nil ? "checked" : ""
webserver.content_send(f"<p><input id='comm' type='checkbox' name='comm' {commissioning_open_checked}>") webserver.content_send(f"<p><input id='comm' type='checkbox' name='comm' {commissioning_open_checked}>")
@ -438,7 +435,11 @@ class Matter_UI
# Add new endpoint section # Add new endpoint section
self.show_plugins_hints_js(self._CLASSES_TYPES) if self.device.zigbee
self.show_plugins_hints_js(self._CLASSES_TYPES_STD, self.device.zigbee._CLASSES_TYPES, self._CLASSES_TYPES_VIRTUAL)
else
self.show_plugins_hints_js(self._CLASSES_TYPES_STD, self._CLASSES_TYPES_VIRTUAL)
end
webserver.content_send("<p></p><fieldset><legend><b>&nbsp;Add to Configuration&nbsp;</b></legend><p></p>" webserver.content_send("<p></p><fieldset><legend><b>&nbsp;Add to Configuration&nbsp;</b></legend><p></p>"
"<p><b>Add local sensor or device</b></p>" "<p><b>Add local sensor or device</b></p>"
@ -453,7 +454,11 @@ class Matter_UI
"<tr>" "<tr>"
"<td style='font-size:smaller;'><input type='text' name='nam' size='1' value='' placeholder='(optional)' title=''></td>" "<td style='font-size:smaller;'><input type='text' name='nam' size='1' value='' placeholder='(optional)' title=''></td>"
"<td style='font-size:smaller;'><select id='pi' name='pi' onchange='otm(\"arg\",this.value)'>") "<td style='font-size:smaller;'><select id='pi' name='pi' onchange='otm(\"arg\",this.value)'>")
self.plugin_option('', self._CLASSES_TYPES) if self.device.zigbee
self.plugin_option('', self._CLASSES_TYPES_STD, self.device.zigbee._CLASSES_TYPES, self._CLASSES_TYPES_VIRTUAL)
else
self.plugin_option('', self._CLASSES_TYPES_STD, self._CLASSES_TYPES_VIRTUAL)
end
webserver.content_send("</select></td>" webserver.content_send("</select></td>"
"<td style='font-size:smaller;'><input type='text' id='arg' name='arg' size='1' value=''></td>" "<td style='font-size:smaller;'><input type='text' id='arg' name='arg' size='1' value=''></td>"
"</tr></table>" "</tr></table>"
@ -509,6 +514,8 @@ class Matter_UI
webserver.content_send("<option value=''></option>") webserver.content_send("<option value=''></option>")
elif typ == '-virtual' elif typ == '-virtual'
webserver.content_send("<option value='' disabled>--- Virtual Devices ---</option>") webserver.content_send("<option value='' disabled>--- Virtual Devices ---</option>")
elif typ == '-zigbee'
webserver.content_send("<option value='' disabled>--- Zigbee Devices ---</option>")
else else
var nam = self.device.get_plugin_class_displayname(typ) var nam = self.device.get_plugin_class_displayname(typ)
webserver.content_send(format("<option value='%s'%s>%s</option>", typ, (typ == cur) ? " selected" : "", nam)) webserver.content_send(format("<option value='%s'%s>%s</option>", typ, (typ == cur) ? " selected" : "", nam))
@ -529,7 +536,7 @@ class Matter_UI
webserver.content_start("Matter Advanced Configuration") #- title of the web page -# webserver.content_start("Matter Advanced Configuration") #- title of the web page -#
webserver.content_send_style() #- send standard Tasmota styles -# webserver.content_send_style() #- send standard Tasmota styles -#
if self.matter_enabled() if self.matter_enabled
self.show_passcode_form() self.show_passcode_form()
self.show_fabric_info() self.show_fabric_info()
end end
@ -551,7 +558,7 @@ class Matter_UI
webserver.content_send_style() #- send standard Tasmota styles -# webserver.content_send_style() #- send standard Tasmota styles -#
self.show_enable() self.show_enable()
if self.matter_enabled() if self.matter_enabled
self.show_plugins_configuration() self.show_plugins_configuration()
end end
@ -731,7 +738,7 @@ class Matter_UI
webserver.content_send_style() #- send standard Tasmota styles -# webserver.content_send_style() #- send standard Tasmota styles -#
var url = webserver.arg("url") var url = webserver.arg("url")
if self.matter_enabled() if self.matter_enabled
self.show_remote_autoconf(url) self.show_remote_autoconf(url)
end end
webserver.content_button(webserver.BUTTON_CONFIGURATION) webserver.content_button(webserver.BUTTON_CONFIGURATION)
@ -785,7 +792,7 @@ class Matter_UI
self.device.save_param() self.device.save_param()
end end
if matter_enabled_requested != self.matter_enabled() if matter_enabled_requested != self.matter_enabled
if matter_enabled_requested if matter_enabled_requested
log(format("MTR: /matterc received '%s' command", 'enable'), 3) log(format("MTR: /matterc received '%s' command", 'enable'), 3)
tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 1") tasmota.cmd("SetOption" + str(matter.MATTER_OPTION) + " 1")
@ -1072,7 +1079,7 @@ class Matter_UI
def web_sensor() def web_sensor()
import webserver import webserver
if self.matter_enabled() if self.matter_enabled
# mtc0 = close, mtc1 = open commissioning # mtc0 = close, mtc1 = open commissioning
var fabrics_count = (self.device.sessions != nil) ? self.device.sessions.count_active_fabrics() : 0 var fabrics_count = (self.device.sessions != nil) ? self.device.sessions.count_active_fabrics() : 0

View File

@ -0,0 +1,198 @@
#
# Matter_z_Zigbee.be - implements common Zigbee handling
#
# Copyright (C) 2023 Stephan Hadinger & Theo Arends
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import matter
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# IMPORTANT: this class is included in build only if `#define USE_ZIGBEE` is defined in `C`
#
# This is managed in matter_module with includes
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#@ solidify:Matter_Zigbee_Mapper,weak
##########################################################################################
# Matter_Zigbee_Mapper
#
# Class used to enrich Matter plug-in and do the mapping.
# This helps avoiding duplication of code
##########################################################################################
class Matter_Zigbee_Mapper
var pi # plug-in for this mapper
var device_arg # contains the device shortaddr (int) or device name (str) as per configuration JSON
# we need to store it, because the zigbee subsystem is not initialized when Matter starts
# hence lookup needs to be postponed
var zigbee_device # zigbee device
var shortaddr # shortaddr to facilitatefiltering
def init(pi)
self.pi = pi
end
#############################################################
# parse_configuration
#
# Parse configuration map
def parse_configuration(config)
import zigbee
import string
self.device_arg = config.find(self.pi.ARG #-'zigbee_device'-#, nil)
# we accept hex integers
if (type(self.device_arg) == 'string')
if string.startswith(self.device_arg, "0x") || string.startswith(self.device_arg, "0X")
self.device_arg = int(self.device_arg)
end
end
if (self.device_arg != nil)
tasmota.set_timer(100, /-> self.probe_zb_values()) # delayed on purpose to make sure all matter is initialized
end
end
#############################################################
# read_zb_info
#
# Run the equivalent of `ZbInfo` and return the atttribute_list
#
# Return nil if something went wrong
def read_zb_info()
if self.resolve_zb_device()
import zigbee
var device = zigbee.find(self.shortaddr)
if (device != nil)
var info = device.info()
return info
end
end
end
#############################################################
# probe_zb_values
#
# Probe stored values so we don't need to wait for the sensor
# to send a new value
#
# It is virtually equivalent to doing `ZbInfo` and parsing
# the last known value
def probe_zb_values()
var info = self.read_zb_info()
if (info != nil)
log(f"MTR: Read information for zigbee device 0x{self.shortaddr:%04X}", 3)
# handle it like if it was attributes received
self.pi.zigbee_received(nil, info)
end
end
#############################################################
# resolve_zb_device
#
# Lazily resolve the device id
# return true if found, false if not found or zigbee not started
def resolve_zb_device()
import zigbee
if (self.device_arg == nil) return false end
if (self.shortaddr != nil) return true end
self.zigbee_device = zigbee.find(self.device_arg)
if self.zigbee_device
self.shortaddr = self.zigbee_device.shortaddr
return true
else
log(f"MTR: cannot find zigbee device '{self.device_arg}'", 3)
return false
end
end
#############################################################
# zb_single_command
#
# Convert a `MtrReceived` unitary payload to a Zigbee command
def zb_single_command(key, value)
# to ease caller, we accept nil arguments and do nothing
var cmd
if (key == 'Power')
cmd = f'ZbSend {{"Device":"0x{self.shortaddr:04X}","Send":{{"Power":{value:i}}}}}'
elif (key == 'Bri')
cmd = f'ZbSend {{"Device":"0x{self.shortaddr:04X}","Send":{{"Dimmer":{value:i}}}}}'
elif (key == 'CT')
cmd = f'ZbSend {{"Device":"0x{self.shortaddr:04X}","Send":{{"CT":{value:i}}}}}'
end
# send command
if (cmd != nil)
if tasmota.loglevel(3)
log(f"MTR: '{cmd}'", 3)
end
tasmota.cmd(cmd, true)
end
end
end
##########################################################################################
# Matter_Zigbee
#
# Helper class for managing mapping between Matter and Zigbee
##########################################################################################
class Matter_Zigbee
static var Matter_Zigbee_Mapper = Matter_Zigbee_Mapper
var device # reference to the main Device instance
# UI
static var _CLASSES_TYPES = # Zigbee
"-zigbee|z_light0|z_light1|z_light2|z_temp|z_pressure|z_humidity|z_occupancy"
#############################################################
def init(device)
import zigbee
self.device = device
zigbee.add_handler(self) # listen to all events received
end
#############################################################
# attributes_refined
#
# Called by Zigbee mapping whenever a new event is received
def attributes_final(event_type, frame, attr_list, shortaddr)
# iterate on all applicable endpoint
# log(f"MTR: attributes_final received '{attr_list}' for 0x{shortaddr:04X}", 3)
var plugins = self.device.plugins
var idx = 0
while (idx < size(plugins))
var pi = plugins[idx]
if (pi.ZIGBEE && pi.zigbee_mapper) # first test always works, while second works only if `zigbee` arrtibute exists
if (pi.zigbee_mapper.resolve_zb_device()) # resolve if this wan't done before
if (pi.zigbee_mapper.shortaddr == shortaddr)
pi.zigbee_received(frame, attr_list)
end
end
end
idx += 1
end
end
end
#@ solidify:matter_zigbee,weak
matter_zigbee = module('matter_zigbee')
matter_zigbee.Matter_Zigbee = Matter_Zigbee
def matter_zigbee_init(m)
return m.Matter_Zigbee
end
matter_zigbee.init = matter_zigbee_init

View File

@ -39,6 +39,7 @@ class Matter_Device
var commissioning # `matter.Commissioning()` object var commissioning # `matter.Commissioning()` object
var autoconf # `matter.Autoconf()` objects var autoconf # `matter.Autoconf()` objects
var sessions # `matter.Session_Store()` objet var sessions # `matter.Session_Store()` objet
var zigbee # `Mattter_Zigbee()` object, only set if compiled with zigbee, `nil` otherwise
var ui var ui
var tick # increment at each tick, avoids to repeat too frequently some actions var tick # increment at each tick, avoids to repeat too frequently some actions
# Events # Events
@ -62,7 +63,7 @@ class Matter_Device
def init() def init()
import crypto import crypto
if !tasmota.get_option(matter.MATTER_OPTION) if !tasmota.get_option(matter.MATTER_OPTION)
matter.UI(self) # minimal UI self.ui = matter.UI(self, false) # minimal UI
return return
end # abort if SetOption 151 is not set end # abort if SetOption 151 is not set
@ -82,23 +83,8 @@ class Matter_Device
self.sessions.load_fabrics() self.sessions.load_fabrics()
self.message_handler = matter.MessageHandler(self) self.message_handler = matter.MessageHandler(self)
self.events = matter.EventHandler(self) self.events = matter.EventHandler(self)
self.ui = matter.UI(self) self.zigbee = self.init_zigbee()
self.ui = matter.UI(self, true)
if tasmota.wifi()['up'] || tasmota.eth()['up']
self.start()
end
if !tasmota.wifi()['up']
tasmota.add_rule("Wifi#Connected", def ()
self.start()
tasmota.remove_rule("Wifi#Connected", "matter_start")
end, "matter_start")
end
if !tasmota.eth()['up']
tasmota.add_rule("Eth#Connected", def ()
self.start()
tasmota.remove_rule("Eth#Connected", "matter_start")
end, "matter_start")
end
self.commissioning.init_basic_commissioning() self.commissioning.init_basic_commissioning()
tasmota.add_driver(self) tasmota.add_driver(self)
@ -106,6 +92,16 @@ class Matter_Device
self.register_commands() self.register_commands()
end end
#############################################################
# Check if the network just started
def check_network()
if self.started return end # abort if already started
if tasmota.wifi()['up'] || tasmota.eth()['up']
self.start()
end
end
############################################################# #############################################################
# Start Matter device server when the first network is coming up # Start Matter device server when the first network is coming up
def start() def start()
@ -255,6 +251,7 @@ class Matter_Device
# dispatch every 50ms # dispatch every 50ms
# ticks # ticks
def every_50ms() def every_50ms()
self.check_network()
self.tick += 1 self.tick += 1
self.message_handler.every_50ms() self.message_handler.every_50ms()
end end
@ -531,7 +528,7 @@ class Matter_Device
self.ipv4only = bool(j.find("ipv4only", false)) self.ipv4only = bool(j.find("ipv4only", false))
self.disable_bridge_mode = bool(j.find("disable_bridge_mode", false)) self.disable_bridge_mode = bool(j.find("disable_bridge_mode", false))
self.next_ep = j.find("nextep", self.next_ep) self.next_ep = j.find("nextep", self.next_ep)
self.plugins_config = j.find("config") self.plugins_config = j.find("config", {})
self.debug = bool(j.find("debug")) # bool converts nil to false self.debug = bool(j.find("debug")) # bool converts nil to false
if self.plugins_config != nil if self.plugins_config != nil
log(f"MTR: Load_config = {self.plugins_config}", 3) log(f"MTR: Load_config = {self.plugins_config}", 3)
@ -1004,6 +1001,30 @@ class Matter_Device
end end
end end
#####################################################################
# Zigbee support
#
# Returns true if zigbee module is present
#####################################################################
def is_zigbee_present()
import introspect
return (introspect.module('matter_zigbee') != nil)
end
#
def init_zigbee()
if self.is_zigbee_present()
import matter_zigbee
return matter_zigbee(self)
end
end
#
def create_zb_mapper(pi)
if self.zigbee
return self.zigbee.Matter_Zigbee_Mapper(pi)
end
end
end end
matter.Device = Matter_Device matter.Device = Matter_Device

View File

@ -109,7 +109,7 @@ static const bvalue be_ktab_class_Matter_IM[203] = {
/* K100 */ be_nested_str_weak(_X2A_X2A), /* K100 */ be_nested_str_weak(_X2A_X2A),
/* K101 */ be_nested_str_weak(_X2504X), /* K101 */ be_nested_str_weak(_X2504X),
/* K102 */ be_nested_str_weak(_X2A_X2A_X2A_X2A), /* K102 */ be_nested_str_weak(_X2A_X2A_X2A_X2A),
/* K103 */ be_nested_str_weak(_X20_X28_X3E_X25s_X29), /* K103 */ be_nested_str_weak(_X20_X28event_X3E_X25s_X29),
/* K104 */ be_nested_str_weak(MTR_X3A_X20_X3ERead_Event_X28_X256i_X29_X20_X5B_X25s_X5D_X25s_X2F_X25s_X20_X25s_X25s), /* K104 */ be_nested_str_weak(MTR_X3A_X20_X3ERead_Event_X28_X256i_X29_X20_X5B_X25s_X5D_X25s_X2F_X25s_X20_X25s_X25s),
/* K105 */ be_nested_str_weak(finished), /* K105 */ be_nested_str_weak(finished),
/* K106 */ be_nested_str_weak(ready), /* K106 */ be_nested_str_weak(ready),

View File

@ -3,56 +3,57 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor' ktab size: 36, total: 53 (saved 136 bytes) // compact class 'Matter_Plugin_Sensor' ktab size: 37, total: 54 (saved 136 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor[36] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor[37] = {
/* K0 */ be_nested_str_weak(contains), /* K0 */ be_nested_str_weak(init),
/* K1 */ be_nested_str_weak(TempUnit), /* K1 */ be_nested_str_weak(add_read_sensors_schedule),
/* K2 */ be_nested_str_weak(temp_unit), /* K2 */ be_nested_str_weak(UPDATE_TIME),
/* K3 */ be_nested_str_weak(PressureUnit), /* K3 */ be_nested_str_weak(find),
/* K4 */ be_nested_str_weak(pressure_unit), /* K4 */ be_nested_str_weak(JSON_NAME),
/* K5 */ be_nested_str_weak(tasmota_sensor_matcher), /* K5 */ be_nested_str_weak(bool),
/* K6 */ be_nested_str_weak(pre_value), /* K6 */ be_nested_str_weak(shadow_value),
/* K7 */ be_nested_str_weak(match), /* K7 */ be_nested_str_weak(value_changed),
/* K8 */ be_nested_str_weak(shadow_value), /* K8 */ be_nested_str_weak(update_virtual),
/* K9 */ be_nested_str_weak(value_changed), /* K9 */ be_nested_str_weak(parse_configuration),
/* K10 */ be_nested_str_weak(tasmota_sensor_filter), /* K10 */ be_nested_str_weak(tasmota_sensor_filter),
/* K11 */ be_nested_str_weak(find), /* K11 */ be_nested_str_weak(ARG),
/* K12 */ be_nested_str_weak(ARG), /* K12 */ be_nested_str_weak(tasmota_sensor_matcher),
/* K13 */ be_nested_str_weak(tasmota), /* K13 */ be_nested_str_weak(tasmota),
/* K14 */ be_nested_str_weak(Rule_Matcher), /* K14 */ be_nested_str_weak(Rule_Matcher),
/* K15 */ be_nested_str_weak(parse), /* K15 */ be_nested_str_weak(parse),
/* K16 */ be_nested_str_weak(TEMP_C), /* K16 */ be_nested_str_weak(temp_unit),
/* K17 */ be_nested_str_weak(PRESSURE_HPA), /* K17 */ be_nested_str_weak(TEMP_C),
/* K18 */ be_nested_str_weak(VIRTUAL), /* K18 */ be_nested_str_weak(pressure_unit),
/* K19 */ be_nested_str_weak(JSON_NAME), /* K19 */ be_nested_str_weak(PRESSURE_HPA),
/* K20 */ be_nested_str_weak(init), /* K20 */ be_nested_str_weak(webserver),
/* K21 */ be_nested_str_weak(add_read_sensors_schedule), /* K21 */ be_nested_str_weak(get_name),
/* K22 */ be_nested_str_weak(UPDATE_TIME), /* K22 */ be_nested_str_weak(filter_name_html),
/* K23 */ be_nested_str_weak(string), /* K23 */ be_nested_str_weak(content_send),
/* K24 */ be_nested_str_weak(webserver), /* K24 */ be_nested_str_weak(PREFIX),
/* K25 */ be_nested_str_weak(html_escape), /* K25 */ be_nested_str_weak(html_escape),
/* K26 */ be_nested_str_weak(split), /* K26 */ be_nested_str_weak(),
/* K27 */ be_nested_str_weak(_X23), /* K27 */ be_nested_str_weak(VIRTUAL),
/* K28 */ be_const_int(0), /* K28 */ be_nested_str_weak(match),
/* K29 */ be_nested_str_weak(), /* K29 */ be_nested_str_weak(pre_value),
/* K30 */ be_nested_str_weak(get_name), /* K30 */ be_nested_str_weak(string),
/* K31 */ be_nested_str_weak(filter_name_html), /* K31 */ be_nested_str_weak(split),
/* K32 */ be_nested_str_weak(content_send), /* K32 */ be_nested_str_weak(_X23),
/* K33 */ be_nested_str_weak(PREFIX), /* K33 */ be_const_int(0),
/* K34 */ be_nested_str_weak(bool), /* K34 */ be_nested_str_weak(contains),
/* K35 */ be_nested_str_weak(update_virtual), /* K35 */ be_nested_str_weak(TempUnit),
/* K36 */ be_nested_str_weak(PressureUnit),
}; };
extern const bclass be_class_Matter_Plugin_Sensor; extern const bclass be_class_Matter_Plugin_Sensor;
/******************************************************************** /********************************************************************
** Solidified function: parse_status ** Solidified function: init
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_parse_status, /* name */ be_local_closure(class_Matter_Plugin_Sensor_init, /* name */
be_nested_proto( be_nested_proto(
9, /* nstack */ 9, /* nstack */
3, /* argc */ 4, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -60,44 +61,72 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_status, /* name */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(parse_status), be_str_weak(init),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[35]) { /* code */ ( &(const binstruction[12]) { /* code */
0x540E0009, // 0000 LDINT R3 10 0x60100003, // 0000 GETGBL R4 G3
0x1C0C0403, // 0001 EQ R3 R2 R3 0x5C140000, // 0001 MOVE R5 R0
0x780E001E, // 0002 JMPF R3 #0022 0x7C100200, // 0002 CALL R4 1
0x8C0C0300, // 0003 GETMET R3 R1 K0 0x8C100900, // 0003 GETMET R4 R4 K0
0x58140001, // 0004 LDCONST R5 K1 0x5C180200, // 0004 MOVE R6 R1
0x7C0C0400, // 0005 CALL R3 2 0x5C1C0400, // 0005 MOVE R7 R2
0x780E0001, // 0006 JMPF R3 #0009 0x5C200600, // 0006 MOVE R8 R3
0x940C0301, // 0007 GETIDX R3 R1 K1 0x7C100800, // 0007 CALL R4 4
0x90020403, // 0008 SETMBR R0 K2 R3 0x8C100301, // 0008 GETMET R4 R1 K1
0x8C0C0300, // 0009 GETMET R3 R1 K0 0x88180102, // 0009 GETMBR R6 R0 K2
0x58140003, // 000A LDCONST R5 K3 0x7C100400, // 000A CALL R4 2
0x7C0C0400, // 000B CALL R3 2 0x80000000, // 000B RET 0
0x780E0001, // 000C JMPF R3 #000F })
0x940C0303, // 000D GETIDX R3 R1 K3 )
0x90020803, // 000E SETMBR R0 K4 R3 );
0x880C0105, // 000F GETMBR R3 R0 K5 /*******************************************************************/
0x780E0010, // 0010 JMPF R3 #0022
0x8C0C0106, // 0011 GETMET R3 R0 K6
0x6014000A, // 0012 GETGBL R5 G10 /********************************************************************
0x88180105, // 0013 GETMBR R6 R0 K5 ** Solidified function: update_virtual
0x8C180D07, // 0014 GETMET R6 R6 K7 ********************************************************************/
0x5C200200, // 0015 MOVE R8 R1 be_local_closure(class_Matter_Plugin_Sensor_update_virtual, /* name */
0x7C180400, // 0016 CALL R6 2 be_nested_proto(
0x7C140200, // 0017 CALL R5 1 6, /* nstack */
0x7C0C0400, // 0018 CALL R3 2 2, /* argc */
0x4C100000, // 0019 LDNIL R4 10, /* varg */
0x20100604, // 001A NE R4 R3 R4 0, /* has upvals */
0x78120005, // 001B JMPF R4 #0022 NULL, /* no upvals */
0x88100108, // 001C GETMBR R4 R0 K8 0, /* has sup protos */
0x20100604, // 001D NE R4 R3 R4 NULL, /* no sub protos */
0x78120002, // 001E JMPF R4 #0022 1, /* has constants */
0x8C100109, // 001F GETMET R4 R0 K9 &be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
0x7C100200, // 0020 CALL R4 1 be_str_weak(update_virtual),
0x90021003, // 0021 SETMBR R0 K8 R3 &be_const_str_solidified,
0x80000000, // 0022 RET 0 ( &(const binstruction[28]) { /* code */
0x8C080303, // 0000 GETMET R2 R1 K3
0x88100104, // 0001 GETMBR R4 R0 K4
0x7C080400, // 0002 CALL R2 2
0x4C0C0000, // 0003 LDNIL R3
0x200C0403, // 0004 NE R3 R2 R3
0x780E000E, // 0005 JMPF R3 #0015
0x600C0004, // 0006 GETGBL R3 G4
0x5C100400, // 0007 MOVE R4 R2
0x7C0C0200, // 0008 CALL R3 1
0x1C0C0705, // 0009 EQ R3 R3 K5
0x780E0003, // 000A JMPF R3 #000F
0x600C0009, // 000B GETGBL R3 G9
0x5C100400, // 000C MOVE R4 R2
0x7C0C0200, // 000D CALL R3 1
0x5C080600, // 000E MOVE R2 R3
0x880C0106, // 000F GETMBR R3 R0 K6
0x200C0602, // 0010 NE R3 R3 R2
0x780E0002, // 0011 JMPF R3 #0015
0x8C0C0107, // 0012 GETMET R3 R0 K7
0x7C0C0200, // 0013 CALL R3 1
0x90020C02, // 0014 SETMBR R0 K6 R2
0x600C0003, // 0015 GETGBL R3 G3
0x5C100000, // 0016 MOVE R4 R0
0x7C0C0200, // 0017 CALL R3 1
0x8C0C0708, // 0018 GETMET R3 R3 K8
0x5C140200, // 0019 MOVE R5 R1
0x7C0C0400, // 001A CALL R3 2
0x80000000, // 001B RET 0
}) })
) )
); );
@ -120,24 +149,30 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_configuration, /* name */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[17]) { /* code */ ( &(const binstruction[23]) { /* code */
0x8C08030B, // 0000 GETMET R2 R1 K11 0x60080003, // 0000 GETGBL R2 G3
0x8810010C, // 0001 GETMBR R4 R0 K12 0x5C0C0000, // 0001 MOVE R3 R0
0x7C080400, // 0002 CALL R2 2 0x7C080200, // 0002 CALL R2 1
0x90021402, // 0003 SETMBR R0 K10 R2 0x8C080509, // 0003 GETMET R2 R2 K9
0x8808010A, // 0004 GETMBR R2 R0 K10 0x5C100200, // 0004 MOVE R4 R1
0x780A0005, // 0005 JMPF R2 #000C 0x7C080400, // 0005 CALL R2 2
0xB80A1A00, // 0006 GETNGBL R2 K13 0x8C080303, // 0006 GETMET R2 R1 K3
0x8808050E, // 0007 GETMBR R2 R2 K14 0x8810010B, // 0007 GETMBR R4 R0 K11
0x8C08050F, // 0008 GETMET R2 R2 K15 0x7C080400, // 0008 CALL R2 2
0x8810010A, // 0009 GETMBR R4 R0 K10 0x90021402, // 0009 SETMBR R0 K10 R2
0x7C080400, // 000A CALL R2 2 0x8808010A, // 000A GETMBR R2 R0 K10
0x90020A02, // 000B SETMBR R0 K5 R2 0x780A0005, // 000B JMPF R2 #0012
0x88080110, // 000C GETMBR R2 R0 K16 0xB80A1A00, // 000C GETNGBL R2 K13
0x90020402, // 000D SETMBR R0 K2 R2 0x8808050E, // 000D GETMBR R2 R2 K14
0x88080111, // 000E GETMBR R2 R0 K17 0x8C08050F, // 000E GETMET R2 R2 K15
0x90020802, // 000F SETMBR R0 K4 R2 0x8810010A, // 000F GETMBR R4 R0 K10
0x80000000, // 0010 RET 0 0x7C080400, // 0010 CALL R2 2
0x90021802, // 0011 SETMBR R0 K12 R2
0x88080111, // 0012 GETMBR R2 R0 K17
0x90022002, // 0013 SETMBR R0 K16 R2
0x88080113, // 0014 GETMBR R2 R0 K19
0x90022402, // 0015 SETMBR R0 K18 R2
0x80000000, // 0016 RET 0
}) })
) )
); );
@ -145,12 +180,12 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_configuration, /* name */
/******************************************************************** /********************************************************************
** Solidified function: pre_value ** Solidified function: web_values_prefix
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_pre_value, /* name */ be_local_closure(class_Matter_Plugin_Sensor_web_values_prefix, /* name */
be_nested_proto( be_nested_proto(
2, /* nstack */ 10, /* nstack */
2, /* argc */ 1, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -158,10 +193,29 @@ be_local_closure(class_Matter_Plugin_Sensor_pre_value, /* name */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(pre_value), be_str_weak(web_values_prefix),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */ ( &(const binstruction[20]) { /* code */
0x80040200, // 0000 RET 1 R1 0xA4062800, // 0000 IMPORT R1 K20
0x8C080115, // 0001 GETMET R2 R0 K21
0x7C080200, // 0002 CALL R2 1
0x5C0C0400, // 0003 MOVE R3 R2
0x740E0002, // 0004 JMPT R3 #0008
0x8C0C0116, // 0005 GETMET R3 R0 K22
0x7C0C0200, // 0006 CALL R3 1
0x5C080600, // 0007 MOVE R2 R3
0x8C0C0317, // 0008 GETMET R3 R1 K23
0x60140018, // 0009 GETGBL R5 G24
0x88180118, // 000A GETMBR R6 R0 K24
0x780A0003, // 000B JMPF R2 #0010
0x8C1C0319, // 000C GETMET R7 R1 K25
0x5C240400, // 000D MOVE R9 R2
0x7C1C0400, // 000E CALL R7 2
0x70020000, // 000F JMP #0011
0x581C001A, // 0010 LDCONST R7 K26
0x7C140400, // 0011 CALL R5 2
0x7C0C0400, // 0012 CALL R3 2
0x80000000, // 0013 RET 0
}) })
) )
); );
@ -185,12 +239,12 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_sensors, /* name */
be_str_weak(parse_sensors), be_str_weak(parse_sensors),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[33]) { /* code */ ( &(const binstruction[33]) { /* code */
0x88080112, // 0000 GETMBR R2 R0 K18 0x8808011B, // 0000 GETMBR R2 R0 K27
0x740A001D, // 0001 JMPT R2 #0020 0x740A001D, // 0001 JMPT R2 #0020
0x88080105, // 0002 GETMBR R2 R0 K5 0x8808010C, // 0002 GETMBR R2 R0 K12
0x780A001B, // 0003 JMPF R2 #0020 0x780A001B, // 0003 JMPF R2 #0020
0x88080105, // 0004 GETMBR R2 R0 K5 0x8808010C, // 0004 GETMBR R2 R0 K12
0x8C080507, // 0005 GETMET R2 R2 K7 0x8C08051C, // 0005 GETMET R2 R2 K28
0x5C100200, // 0006 MOVE R4 R1 0x5C100200, // 0006 MOVE R4 R1
0x7C080400, // 0007 CALL R2 2 0x7C080400, // 0007 CALL R2 2
0x600C000F, // 0008 GETGBL R3 G15 0x600C000F, // 0008 GETGBL R3 G15
@ -198,11 +252,11 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_sensors, /* name */
0x60140013, // 000A GETGBL R5 G19 0x60140013, // 000A GETGBL R5 G19
0x7C0C0400, // 000B CALL R3 2 0x7C0C0400, // 000B CALL R3 2
0x780E0003, // 000C JMPF R3 #0011 0x780E0003, // 000C JMPF R3 #0011
0x8C0C050B, // 000D GETMET R3 R2 K11 0x8C0C0503, // 000D GETMET R3 R2 K3
0x88140113, // 000E GETMBR R5 R0 K19 0x88140104, // 000E GETMBR R5 R0 K4
0x7C0C0400, // 000F CALL R3 2 0x7C0C0400, // 000F CALL R3 2
0x5C080600, // 0010 MOVE R2 R3 0x5C080600, // 0010 MOVE R2 R3
0x8C0C0106, // 0011 GETMET R3 R0 K6 0x8C0C011D, // 0011 GETMET R3 R0 K29
0x6014000A, // 0012 GETGBL R5 G10 0x6014000A, // 0012 GETGBL R5 G10
0x5C180400, // 0013 MOVE R6 R2 0x5C180400, // 0013 MOVE R6 R2
0x7C140200, // 0014 CALL R5 1 0x7C140200, // 0014 CALL R5 1
@ -211,12 +265,12 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_sensors, /* name */
0x4C0C0000, // 0017 LDNIL R3 0x4C0C0000, // 0017 LDNIL R3
0x200C0403, // 0018 NE R3 R2 R3 0x200C0403, // 0018 NE R3 R2 R3
0x780E0005, // 0019 JMPF R3 #0020 0x780E0005, // 0019 JMPF R3 #0020
0x880C0108, // 001A GETMBR R3 R0 K8 0x880C0106, // 001A GETMBR R3 R0 K6
0x200C0403, // 001B NE R3 R2 R3 0x200C0403, // 001B NE R3 R2 R3
0x780E0002, // 001C JMPF R3 #0020 0x780E0002, // 001C JMPF R3 #0020
0x8C0C0109, // 001D GETMET R3 R0 K9 0x8C0C0107, // 001D GETMET R3 R0 K7
0x7C0C0200, // 001E CALL R3 1 0x7C0C0200, // 001E CALL R3 1
0x90021002, // 001F SETMBR R0 K8 R2 0x90020C02, // 001F SETMBR R0 K6 R2
0x80000000, // 0020 RET 0 0x80000000, // 0020 RET 0
}) })
) )
@ -224,65 +278,6 @@ be_local_closure(class_Matter_Plugin_Sensor_parse_sensors, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: value_changed
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_value_changed, /* name */
be_nested_proto(
1, /* nstack */
1, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(value_changed),
&be_const_str_solidified,
( &(const binstruction[ 1]) { /* code */
0x80000000, // 0000 RET 0
})
)
);
/*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[12]) { /* code */
0x60100003, // 0000 GETGBL R4 G3
0x5C140000, // 0001 MOVE R5 R0
0x7C100200, // 0002 CALL R4 1
0x8C100914, // 0003 GETMET R4 R4 K20
0x5C180200, // 0004 MOVE R6 R1
0x5C1C0400, // 0005 MOVE R7 R2
0x5C200600, // 0006 MOVE R8 R3
0x7C100800, // 0007 CALL R4 4
0x8C100315, // 0008 GETMET R4 R1 K21
0x88180116, // 0009 GETMBR R6 R0 K22
0x7C100400, // 000A CALL R4 2
0x80000000, // 000B RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: filter_name_html ** Solidified function: filter_name_html
********************************************************************/ ********************************************************************/
@ -302,17 +297,17 @@ be_local_closure(class_Matter_Plugin_Sensor_filter_name_html, /* name */
( &(const binstruction[13]) { /* code */ ( &(const binstruction[13]) { /* code */
0x8804010A, // 0000 GETMBR R1 R0 K10 0x8804010A, // 0000 GETMBR R1 R0 K10
0x78060009, // 0001 JMPF R1 #000C 0x78060009, // 0001 JMPF R1 #000C
0xA4062E00, // 0002 IMPORT R1 K23 0xA4063C00, // 0002 IMPORT R1 K30
0xA40A3000, // 0003 IMPORT R2 K24 0xA40A2800, // 0003 IMPORT R2 K20
0x8C0C0519, // 0004 GETMET R3 R2 K25 0x8C0C0519, // 0004 GETMET R3 R2 K25
0x8C14031A, // 0005 GETMET R5 R1 K26 0x8C14031F, // 0005 GETMET R5 R1 K31
0x881C010A, // 0006 GETMBR R7 R0 K10 0x881C010A, // 0006 GETMBR R7 R0 K10
0x5820001B, // 0007 LDCONST R8 K27 0x58200020, // 0007 LDCONST R8 K32
0x7C140600, // 0008 CALL R5 3 0x7C140600, // 0008 CALL R5 3
0x94140B1C, // 0009 GETIDX R5 R5 K28 0x94140B21, // 0009 GETIDX R5 R5 K33
0x7C0C0400, // 000A CALL R3 2 0x7C0C0400, // 000A CALL R3 2
0x80040600, // 000B RET 1 R3 0x80040600, // 000B RET 1 R3
0x80063A00, // 000C RET 1 K29 0x80063400, // 000C RET 1 K26
}) })
) )
); );
@ -320,12 +315,12 @@ be_local_closure(class_Matter_Plugin_Sensor_filter_name_html, /* name */
/******************************************************************** /********************************************************************
** Solidified function: web_values_prefix ** Solidified function: parse_status
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_web_values_prefix, /* name */ be_local_closure(class_Matter_Plugin_Sensor_parse_status, /* name */
be_nested_proto( be_nested_proto(
10, /* nstack */ 9, /* nstack */
1, /* argc */ 3, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -333,80 +328,44 @@ be_local_closure(class_Matter_Plugin_Sensor_web_values_prefix, /* name */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(web_values_prefix), be_str_weak(parse_status),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[20]) { /* code */ ( &(const binstruction[35]) { /* code */
0xA4063000, // 0000 IMPORT R1 K24 0x540E0009, // 0000 LDINT R3 10
0x8C08011E, // 0001 GETMET R2 R0 K30 0x1C0C0403, // 0001 EQ R3 R2 R3
0x7C080200, // 0002 CALL R2 1 0x780E001E, // 0002 JMPF R3 #0022
0x5C0C0400, // 0003 MOVE R3 R2 0x8C0C0322, // 0003 GETMET R3 R1 K34
0x740E0002, // 0004 JMPT R3 #0008 0x58140023, // 0004 LDCONST R5 K35
0x8C0C011F, // 0005 GETMET R3 R0 K31 0x7C0C0400, // 0005 CALL R3 2
0x7C0C0200, // 0006 CALL R3 1 0x780E0001, // 0006 JMPF R3 #0009
0x5C080600, // 0007 MOVE R2 R3 0x940C0323, // 0007 GETIDX R3 R1 K35
0x8C0C0320, // 0008 GETMET R3 R1 K32 0x90022003, // 0008 SETMBR R0 K16 R3
0x60140018, // 0009 GETGBL R5 G24 0x8C0C0322, // 0009 GETMET R3 R1 K34
0x88180121, // 000A GETMBR R6 R0 K33 0x58140024, // 000A LDCONST R5 K36
0x780A0003, // 000B JMPF R2 #0010 0x7C0C0400, // 000B CALL R3 2
0x8C1C0319, // 000C GETMET R7 R1 K25 0x780E0001, // 000C JMPF R3 #000F
0x5C240400, // 000D MOVE R9 R2 0x940C0324, // 000D GETIDX R3 R1 K36
0x7C1C0400, // 000E CALL R7 2 0x90022403, // 000E SETMBR R0 K18 R3
0x70020000, // 000F JMP #0011 0x880C010C, // 000F GETMBR R3 R0 K12
0x581C001D, // 0010 LDCONST R7 K29 0x780E0010, // 0010 JMPF R3 #0022
0x7C140400, // 0011 CALL R5 2 0x8C0C011D, // 0011 GETMET R3 R0 K29
0x7C0C0400, // 0012 CALL R3 2 0x6014000A, // 0012 GETGBL R5 G10
0x80000000, // 0013 RET 0 0x8818010C, // 0013 GETMBR R6 R0 K12
}) 0x8C180D1C, // 0014 GETMET R6 R6 K28
) 0x5C200200, // 0015 MOVE R8 R1
); 0x7C180400, // 0016 CALL R6 2
/*******************************************************************/ 0x7C140200, // 0017 CALL R5 1
0x7C0C0400, // 0018 CALL R3 2
0x4C100000, // 0019 LDNIL R4
/******************************************************************** 0x20100604, // 001A NE R4 R3 R4
** Solidified function: update_virtual 0x78120005, // 001B JMPF R4 #0022
********************************************************************/ 0x88100106, // 001C GETMBR R4 R0 K6
be_local_closure(class_Matter_Plugin_Sensor_update_virtual, /* name */ 0x20100604, // 001D NE R4 R3 R4
be_nested_proto( 0x78120002, // 001E JMPF R4 #0022
6, /* nstack */ 0x8C100107, // 001F GETMET R4 R0 K7
2, /* argc */ 0x7C100200, // 0020 CALL R4 1
10, /* varg */ 0x90020C03, // 0021 SETMBR R0 K6 R3
0, /* has upvals */ 0x80000000, // 0022 RET 0
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor, /* shared constants */
be_str_weak(update_virtual),
&be_const_str_solidified,
( &(const binstruction[28]) { /* code */
0x8C08030B, // 0000 GETMET R2 R1 K11
0x88100113, // 0001 GETMBR R4 R0 K19
0x7C080400, // 0002 CALL R2 2
0x4C0C0000, // 0003 LDNIL R3
0x200C0403, // 0004 NE R3 R2 R3
0x780E000E, // 0005 JMPF R3 #0015
0x600C0004, // 0006 GETGBL R3 G4
0x5C100400, // 0007 MOVE R4 R2
0x7C0C0200, // 0008 CALL R3 1
0x1C0C0722, // 0009 EQ R3 R3 K34
0x780E0003, // 000A JMPF R3 #000F
0x600C0009, // 000B GETGBL R3 G9
0x5C100400, // 000C MOVE R4 R2
0x7C0C0200, // 000D CALL R3 1
0x5C080600, // 000E MOVE R2 R3
0x880C0108, // 000F GETMBR R3 R0 K8
0x200C0602, // 0010 NE R3 R3 R2
0x780E0002, // 0011 JMPF R3 #0015
0x8C0C0109, // 0012 GETMET R3 R0 K9
0x7C0C0200, // 0013 CALL R3 1
0x90021002, // 0014 SETMBR R0 K8 R2
0x600C0003, // 0015 GETGBL R3 G3
0x5C100000, // 0016 MOVE R4 R0
0x7C0C0200, // 0017 CALL R3 1
0x8C0C0723, // 0018 GETMET R3 R3 K35
0x5C140200, // 0019 MOVE R5 R1
0x7C0C0400, // 001A CALL R3 2
0x80000000, // 001B RET 0
}) })
) )
); );
@ -420,32 +379,30 @@ extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Sensor, be_local_class(Matter_Plugin_Sensor,
5, 5,
&be_class_Matter_Plugin_Device, &be_class_Matter_Plugin_Device,
be_nested_map(24, be_nested_map(22,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) }, { be_const_key_weak(tasmota_sensor_filter, -1), be_const_var(0) },
{ be_const_key_weak(TEMP_C, -1), be_nested_str_weak(C) }, { be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Filter_X20pattern) },
{ be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) }, { be_const_key_weak(parse_status, 4), be_const_closure(class_Matter_Plugin_Sensor_parse_status_closure) },
{ be_const_key_weak(shadow_value, 19), be_const_var(2) },
{ be_const_key_weak(PRESSURE_MMHG, -1), be_nested_str_weak(mmHg) },
{ be_const_key_weak(parse_status, -1), be_const_closure(class_Matter_Plugin_Sensor_parse_status_closure) },
{ be_const_key_weak(TEMP_F, -1), be_nested_str_weak(F) },
{ be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_Sensor_update_virtual_closure) }, { be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_Sensor_update_virtual_closure) },
{ be_const_key_weak(pre_value, 7), be_const_closure(class_Matter_Plugin_Sensor_pre_value_closure) }, { be_const_key_weak(parse_configuration, -1), be_const_closure(class_Matter_Plugin_Sensor_parse_configuration_closure) },
{ be_const_key_weak(ARG_HINT, 14), be_nested_str_weak(Filter_X20pattern) },
{ be_const_key_weak(tasmota_sensor_filter, 6), be_const_var(0) },
{ be_const_key_weak(UPDATE_CMD, -1), be_nested_str_weak(Status_X2010) },
{ be_const_key_weak(parse_sensors, -1), be_const_closure(class_Matter_Plugin_Sensor_parse_sensors_closure) },
{ be_const_key_weak(parse_configuration, 20), be_const_closure(class_Matter_Plugin_Sensor_parse_configuration_closure) },
{ be_const_key_weak(PRESSURE_INHG, -1), be_nested_str_weak(inHg) },
{ be_const_key_weak(ARG, 11), be_nested_str_weak(filter) },
{ be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_web_values_prefix_closure) },
{ be_const_key_weak(filter_name_html, 16), be_const_closure(class_Matter_Plugin_Sensor_filter_name_html_closure) },
{ be_const_key_weak(PRESSURE_HPA, -1), be_nested_str_weak(hPa) },
{ be_const_key_weak(init, 5), be_const_closure(class_Matter_Plugin_Sensor_init_closure) },
{ be_const_key_weak(value_changed, 21), be_const_closure(class_Matter_Plugin_Sensor_value_changed_closure) },
{ be_const_key_weak(pressure_unit, -1), be_const_var(4) }, { be_const_key_weak(pressure_unit, -1), be_const_var(4) },
{ be_const_key_weak(temp_unit, -1), be_const_var(3) }, { be_const_key_weak(tasmota_sensor_matcher, -1), be_const_var(1) },
{ be_const_key_weak(JSON_NAME, -1), be_nested_str_weak() }, { be_const_key_weak(ARG, -1), be_nested_str_weak(filter) },
{ be_const_key_weak(PRESSURE_MMHG, -1), be_nested_str_weak(mmHg) },
{ be_const_key_weak(init, -1), be_const_closure(class_Matter_Plugin_Sensor_init_closure) },
{ be_const_key_weak(TEMP_F, -1), be_nested_str_weak(F) },
{ be_const_key_weak(TEMP_C, -1), be_nested_str_weak(C) },
{ be_const_key_weak(temp_unit, 3), be_const_var(3) },
{ be_const_key_weak(UPDATE_CMD, 16), be_nested_str_weak(Status_X2010) },
{ be_const_key_weak(PRESSURE_HPA, 10), be_nested_str_weak(hPa) },
{ be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_web_values_prefix_closure) },
{ be_const_key_weak(PRESSURE_INHG, -1), be_nested_str_weak(inHg) },
{ be_const_key_weak(JSON_NAME, 13), be_nested_str_weak() },
{ be_const_key_weak(parse_sensors, -1), be_const_closure(class_Matter_Plugin_Sensor_parse_sensors_closure) },
{ be_const_key_weak(filter_name_html, -1), be_const_closure(class_Matter_Plugin_Sensor_filter_name_html_closure) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(5000) },
{ be_const_key_weak(shadow_value, 2), be_const_var(2) },
})), })),
be_str_weak(Matter_Plugin_Sensor) be_str_weak(Matter_Plugin_Sensor)
); );

View File

@ -3,8 +3,8 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_Air_Quality' ktab size: 36, total: 73 (saved 296 bytes) // compact class 'Matter_Plugin_Sensor_Air_Quality' ktab size: 37, total: 74 (saved 296 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_Air_Quality[36] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_Air_Quality[37] = {
/* K0 */ be_nested_str_weak(web_values_prefix), /* K0 */ be_nested_str_weak(web_values_prefix),
/* K1 */ be_nested_str_weak(Air), /* K1 */ be_nested_str_weak(Air),
/* K2 */ be_nested_str_weak(shadow_air_quality), /* K2 */ be_nested_str_weak(shadow_air_quality),
@ -36,11 +36,12 @@ static const bvalue be_ktab_class_Matter_Plugin_Sensor_Air_Quality[36] = {
/* K28 */ be_nested_str_weak(set_or_nil), /* K28 */ be_nested_str_weak(set_or_nil),
/* K29 */ be_nested_str_weak(U1), /* K29 */ be_nested_str_weak(U1),
/* K30 */ be_nested_str_weak(read_attribute), /* K30 */ be_nested_str_weak(read_attribute),
/* K31 */ be_nested_str_weak(ARG), /* K31 */ be_nested_str_weak(parse_configuration),
/* K32 */ be_nested_str_weak(_parse_sensor_entry), /* K32 */ be_nested_str_weak(ARG),
/* K33 */ be_nested_str_weak(CarbonDioxide), /* K33 */ be_nested_str_weak(_parse_sensor_entry),
/* K34 */ be_nested_str_weak(parse_sensors), /* K34 */ be_nested_str_weak(CarbonDioxide),
/* K35 */ be_nested_str_weak(attribute_updated), /* K35 */ be_nested_str_weak(parse_sensors),
/* K36 */ be_nested_str_weak(attribute_updated),
}; };
@ -520,14 +521,20 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_configuration, /
&be_ktab_class_Matter_Plugin_Sensor_Air_Quality, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor_Air_Quality, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */ ( &(const binstruction[13]) { /* code */
0x60080008, // 0000 GETGBL R2 G8 0x60080003, // 0000 GETGBL R2 G3
0x8C0C030F, // 0001 GETMET R3 R1 K15 0x5C0C0000, // 0001 MOVE R3 R0
0x8814011F, // 0002 GETMBR R5 R0 K31 0x7C080200, // 0002 CALL R2 1
0x7C0C0400, // 0003 CALL R3 2 0x8C08051F, // 0003 GETMET R2 R2 K31
0x7C080200, // 0004 CALL R2 1 0x5C100200, // 0004 MOVE R4 R1
0x90022002, // 0005 SETMBR R0 K16 R2 0x7C080400, // 0005 CALL R2 2
0x80000000, // 0006 RET 0 0x60080008, // 0006 GETGBL R2 G8
0x8C0C030F, // 0007 GETMET R3 R1 K15
0x88140120, // 0008 GETMBR R5 R0 K32
0x7C0C0400, // 0009 CALL R3 2
0x7C080200, // 000A CALL R2 1
0x90022002, // 000B SETMBR R0 K16 R2
0x80000000, // 000C RET 0
}) })
) )
); );
@ -557,16 +564,16 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x4C0C0000, // 0003 LDNIL R3 0x4C0C0000, // 0003 LDNIL R3
0x200C0403, // 0004 NE R3 R2 R3 0x200C0403, // 0004 NE R3 R2 R3
0x780E0035, // 0005 JMPF R3 #003C 0x780E0035, // 0005 JMPF R3 #003C
0x8C0C0120, // 0006 GETMET R3 R0 K32 0x8C0C0121, // 0006 GETMET R3 R0 K33
0x5C140400, // 0007 MOVE R5 R2 0x5C140400, // 0007 MOVE R5 R2
0x58180021, // 0008 LDCONST R6 K33 0x58180022, // 0008 LDCONST R6 K34
0x881C010A, // 0009 GETMBR R7 R0 K10 0x881C010A, // 0009 GETMBR R7 R0 K10
0x60200007, // 000A GETGBL R8 G7 0x60200007, // 000A GETGBL R8 G7
0x5426040C, // 000B LDINT R9 1037 0x5426040C, // 000B LDINT R9 1037
0x58280013, // 000C LDCONST R10 K19 0x58280013, // 000C LDCONST R10 K19
0x7C0C0E00, // 000D CALL R3 7 0x7C0C0E00, // 000D CALL R3 7
0x90021403, // 000E SETMBR R0 K10 R3 0x90021403, // 000E SETMBR R0 K10 R3
0x8C0C0120, // 000F GETMET R3 R0 K32 0x8C0C0121, // 000F GETMET R3 R0 K33
0x5C140400, // 0010 MOVE R5 R2 0x5C140400, // 0010 MOVE R5 R2
0x58180003, // 0011 LDCONST R6 K3 0x58180003, // 0011 LDCONST R6 K3
0x881C0104, // 0012 GETMBR R7 R0 K4 0x881C0104, // 0012 GETMBR R7 R0 K4
@ -575,7 +582,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x58280013, // 0015 LDCONST R10 K19 0x58280013, // 0015 LDCONST R10 K19
0x7C0C0E00, // 0016 CALL R3 7 0x7C0C0E00, // 0016 CALL R3 7
0x90020803, // 0017 SETMBR R0 K4 R3 0x90020803, // 0017 SETMBR R0 K4 R3
0x8C0C0120, // 0018 GETMET R3 R0 K32 0x8C0C0121, // 0018 GETMET R3 R0 K33
0x5C140400, // 0019 MOVE R5 R2 0x5C140400, // 0019 MOVE R5 R2
0x58180005, // 001A LDCONST R6 K5 0x58180005, // 001A LDCONST R6 K5
0x881C0106, // 001B GETMBR R7 R0 K6 0x881C0106, // 001B GETMBR R7 R0 K6
@ -584,7 +591,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x58280013, // 001E LDCONST R10 K19 0x58280013, // 001E LDCONST R10 K19
0x7C0C0E00, // 001F CALL R3 7 0x7C0C0E00, // 001F CALL R3 7
0x90020C03, // 0020 SETMBR R0 K6 R3 0x90020C03, // 0020 SETMBR R0 K6 R3
0x8C0C0120, // 0021 GETMET R3 R0 K32 0x8C0C0121, // 0021 GETMET R3 R0 K33
0x5C140400, // 0022 MOVE R5 R2 0x5C140400, // 0022 MOVE R5 R2
0x58180007, // 0023 LDCONST R6 K7 0x58180007, // 0023 LDCONST R6 K7
0x881C0108, // 0024 GETMBR R7 R0 K8 0x881C0108, // 0024 GETMBR R7 R0 K8
@ -593,7 +600,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x58280013, // 0027 LDCONST R10 K19 0x58280013, // 0027 LDCONST R10 K19
0x7C0C0E00, // 0028 CALL R3 7 0x7C0C0E00, // 0028 CALL R3 7
0x90021003, // 0029 SETMBR R0 K8 R3 0x90021003, // 0029 SETMBR R0 K8 R3
0x8C0C0120, // 002A GETMET R3 R0 K32 0x8C0C0121, // 002A GETMET R3 R0 K33
0x5C140400, // 002B MOVE R5 R2 0x5C140400, // 002B MOVE R5 R2
0x5818000D, // 002C LDCONST R6 K13 0x5818000D, // 002C LDCONST R6 K13
0x881C010E, // 002D GETMBR R7 R0 K14 0x881C010E, // 002D GETMBR R7 R0 K14
@ -602,7 +609,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x58280013, // 0030 LDCONST R10 K19 0x58280013, // 0030 LDCONST R10 K19
0x7C0C0E00, // 0031 CALL R3 7 0x7C0C0E00, // 0031 CALL R3 7
0x90021C03, // 0032 SETMBR R0 K14 R3 0x90021C03, // 0032 SETMBR R0 K14 R3
0x8C0C0120, // 0033 GETMET R3 R0 K32 0x8C0C0121, // 0033 GETMET R3 R0 K33
0x5C140400, // 0034 MOVE R5 R2 0x5C140400, // 0034 MOVE R5 R2
0x5818000B, // 0035 LDCONST R6 K11 0x5818000B, // 0035 LDCONST R6 K11
0x881C010C, // 0036 GETMBR R7 R0 K12 0x881C010C, // 0036 GETMBR R7 R0 K12
@ -614,7 +621,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality_parse_sensors, /* name
0x600C0003, // 003C GETGBL R3 G3 0x600C0003, // 003C GETGBL R3 G3
0x5C100000, // 003D MOVE R4 R0 0x5C100000, // 003D MOVE R4 R0
0x7C0C0200, // 003E CALL R3 1 0x7C0C0200, // 003E CALL R3 1
0x8C0C0722, // 003F GETMET R3 R3 K34 0x8C0C0723, // 003F GETMET R3 R3 K35
0x5C140200, // 0040 MOVE R5 R1 0x5C140200, // 0040 MOVE R5 R1
0x7C0C0400, // 0041 CALL R3 2 0x7C0C0400, // 0041 CALL R3 2
0x80000000, // 0042 RET 0 0x80000000, // 0042 RET 0
@ -656,7 +663,7 @@ be_local_closure(class_Matter_Plugin_Sensor_Air_Quality__parse_sensor_entry, /
0x78220005, // 000C JMPF R8 #0013 0x78220005, // 000C JMPF R8 #0013
0x20200E03, // 000D NE R8 R7 R3 0x20200E03, // 000D NE R8 R7 R3
0x78220003, // 000E JMPF R8 #0013 0x78220003, // 000E JMPF R8 #0013
0x8C200123, // 000F GETMET R8 R0 K35 0x8C200124, // 000F GETMET R8 R0 K36
0x5C280A00, // 0010 MOVE R10 R5 0x5C280A00, // 0010 MOVE R10 R5
0x5C2C0C00, // 0011 MOVE R11 R6 0x5C2C0C00, // 0011 MOVE R11 R6
0x7C200600, // 0012 CALL R8 3 0x7C200600, // 0012 CALL R8 3

View File

@ -3,37 +3,41 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_Boolean' ktab size: 17, total: 26 (saved 72 bytes) // compact class 'Matter_Plugin_Sensor_Boolean' ktab size: 21, total: 32 (saved 88 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_Boolean[17] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_Boolean[21] = {
/* K0 */ be_nested_str_weak(tasmota_switch_index), /* K0 */ be_nested_str_weak(update_shadow),
/* K1 */ be_nested_str_weak(find), /* K1 */ be_nested_str_weak(VIRTUAL),
/* K2 */ be_nested_str_weak(ARG), /* K2 */ be_nested_str_weak(Switch),
/* K3 */ be_const_int(1), /* K3 */ be_nested_str_weak(tasmota_switch_index),
/* K4 */ be_const_int(0), /* K4 */ be_nested_str_weak(tasmota),
/* K5 */ be_nested_str_weak(update_shadow), /* K5 */ be_nested_str_weak(cmd),
/* K6 */ be_nested_str_weak(VIRTUAL), /* K6 */ be_nested_str_weak(Status_X2010),
/* K7 */ be_nested_str_weak(Switch), /* K7 */ be_nested_str_weak(find),
/* K8 */ be_nested_str_weak(tasmota), /* K8 */ be_nested_str_weak(StatusSNS),
/* K9 */ be_nested_str_weak(cmd), /* K9 */ be_nested_str_weak(contains),
/* K10 */ be_nested_str_weak(Status_X2010), /* K10 */ be_nested_str_weak(ON),
/* K11 */ be_nested_str_weak(StatusSNS), /* K11 */ be_nested_str_weak(shadow_bool_value),
/* K12 */ be_nested_str_weak(contains), /* K12 */ be_nested_str_weak(value_updated),
/* K13 */ be_nested_str_weak(ON), /* K13 */ be_nested_str_weak(init),
/* K14 */ be_nested_str_weak(shadow_bool_value), /* K14 */ be_nested_str_weak(parse_configuration),
/* K15 */ be_nested_str_weak(value_updated), /* K15 */ be_nested_str_weak(ARG),
/* K16 */ be_nested_str_weak(init), /* K16 */ be_const_int(1),
/* K17 */ be_const_int(0),
/* K18 */ be_nested_str_weak(_parse_update_virtual),
/* K19 */ be_nested_str_weak(JSON_NAME),
/* K20 */ be_nested_str_weak(update_virtual),
}; };
extern const bclass be_class_Matter_Plugin_Sensor_Boolean; extern const bclass be_class_Matter_Plugin_Sensor_Boolean;
/******************************************************************** /********************************************************************
** Solidified function: parse_configuration ** Solidified function: update_shadow
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Boolean_parse_configuration, /* name */ be_local_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow, /* name */
be_nested_proto( be_nested_proto(
7, /* nstack */ 6, /* nstack */
2, /* argc */ 1, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -41,21 +45,50 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_parse_configuration, /* na
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(update_shadow),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[12]) { /* code */ ( &(const binstruction[41]) { /* code */
0x60080009, // 0000 GETGBL R2 G9 0x60040003, // 0000 GETGBL R1 G3
0x8C0C0301, // 0001 GETMET R3 R1 K1 0x5C080000, // 0001 MOVE R2 R0
0x88140102, // 0002 GETMBR R5 R0 K2 0x7C040200, // 0002 CALL R1 1
0x58180003, // 0003 LDCONST R6 K3 0x8C040300, // 0003 GETMET R1 R1 K0
0x7C0C0600, // 0004 CALL R3 3 0x7C040200, // 0004 CALL R1 1
0x7C080200, // 0005 CALL R2 1 0x88040101, // 0005 GETMBR R1 R0 K1
0x90020002, // 0006 SETMBR R0 K0 R2 0x74060020, // 0006 JMPT R1 #0028
0x88080100, // 0007 GETMBR R2 R0 K0 0x60040008, // 0007 GETGBL R1 G8
0x18080504, // 0008 LE R2 R2 K4 0x88080103, // 0008 GETMBR R2 R0 K3
0x780A0000, // 0009 JMPF R2 #000B 0x7C040200, // 0009 CALL R1 1
0x90020103, // 000A SETMBR R0 K0 K3 0x00060401, // 000A ADD R1 K2 R1
0x80000000, // 000B RET 0 0xB80A0800, // 000B GETNGBL R2 K4
0x8C080505, // 000C GETMET R2 R2 K5
0x58100006, // 000D LDCONST R4 K6
0x50140200, // 000E LDBOOL R5 1 0
0x7C080600, // 000F CALL R2 3
0x4C0C0000, // 0010 LDNIL R3
0x200C0403, // 0011 NE R3 R2 R3
0x780E0003, // 0012 JMPF R3 #0017
0x8C0C0507, // 0013 GETMET R3 R2 K7
0x58140008, // 0014 LDCONST R5 K8
0x7C0C0400, // 0015 CALL R3 2
0x5C080600, // 0016 MOVE R2 R3
0x4C0C0000, // 0017 LDNIL R3
0x200C0403, // 0018 NE R3 R2 R3
0x780E000D, // 0019 JMPF R3 #0028
0x8C0C0509, // 001A GETMET R3 R2 K9
0x5C140200, // 001B MOVE R5 R1
0x7C0C0400, // 001C CALL R3 2
0x780E0009, // 001D JMPF R3 #0028
0x8C0C0507, // 001E GETMET R3 R2 K7
0x5C140200, // 001F MOVE R5 R1
0x7C0C0400, // 0020 CALL R3 2
0x1C0C070A, // 0021 EQ R3 R3 K10
0x8810010B, // 0022 GETMBR R4 R0 K11
0x20100803, // 0023 NE R4 R4 R3
0x78120001, // 0024 JMPF R4 #0027
0x8C10010C, // 0025 GETMET R4 R0 K12
0x7C100200, // 0026 CALL R4 1
0x90021603, // 0027 SETMBR R0 K11 R3
0x80000000, // 0028 RET 0
}) })
) )
); );
@ -86,6 +119,40 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_value_updated, /* name */
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: init
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Boolean_init, /* name */
be_nested_proto(
9, /* nstack */
4, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */
be_str_weak(init),
&be_const_str_solidified,
( &(const binstruction[11]) { /* code */
0x60100003, // 0000 GETGBL R4 G3
0x5C140000, // 0001 MOVE R5 R0
0x7C100200, // 0002 CALL R4 1
0x8C10090D, // 0003 GETMET R4 R4 K13
0x5C180200, // 0004 MOVE R6 R1
0x5C1C0400, // 0005 MOVE R7 R2
0x5C200600, // 0006 MOVE R8 R3
0x7C100800, // 0007 CALL R4 4
0x50100000, // 0008 LDBOOL R4 0 0
0x90021604, // 0009 SETMBR R0 K11 R4
0x80000000, // 000A RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: <lambda> ** Solidified function: <lambda>
********************************************************************/ ********************************************************************/
@ -114,12 +181,12 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean__X3Clambda_X3E, /* name */
/******************************************************************** /********************************************************************
** Solidified function: update_shadow ** Solidified function: parse_configuration
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow, /* name */ be_local_closure(class_Matter_Plugin_Sensor_Boolean_parse_configuration, /* name */
be_nested_proto( be_nested_proto(
6, /* nstack */ 7, /* nstack */
1, /* argc */ 2, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -127,50 +194,27 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow, /* name */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */
be_str_weak(update_shadow), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[41]) { /* code */ ( &(const binstruction[18]) { /* code */
0x60040003, // 0000 GETGBL R1 G3 0x60080003, // 0000 GETGBL R2 G3
0x5C080000, // 0001 MOVE R2 R0 0x5C0C0000, // 0001 MOVE R3 R0
0x7C040200, // 0002 CALL R1 1 0x7C080200, // 0002 CALL R2 1
0x8C040305, // 0003 GETMET R1 R1 K5 0x8C08050E, // 0003 GETMET R2 R2 K14
0x7C040200, // 0004 CALL R1 1 0x5C100200, // 0004 MOVE R4 R1
0x88040106, // 0005 GETMBR R1 R0 K6 0x7C080400, // 0005 CALL R2 2
0x74060020, // 0006 JMPT R1 #0028 0x60080009, // 0006 GETGBL R2 G9
0x60040008, // 0007 GETGBL R1 G8 0x8C0C0307, // 0007 GETMET R3 R1 K7
0x88080100, // 0008 GETMBR R2 R0 K0 0x8814010F, // 0008 GETMBR R5 R0 K15
0x7C040200, // 0009 CALL R1 1 0x58180010, // 0009 LDCONST R6 K16
0x00060E01, // 000A ADD R1 K7 R1 0x7C0C0600, // 000A CALL R3 3
0xB80A1000, // 000B GETNGBL R2 K8 0x7C080200, // 000B CALL R2 1
0x8C080509, // 000C GETMET R2 R2 K9 0x90020602, // 000C SETMBR R0 K3 R2
0x5810000A, // 000D LDCONST R4 K10 0x88080103, // 000D GETMBR R2 R0 K3
0x50140200, // 000E LDBOOL R5 1 0 0x18080511, // 000E LE R2 R2 K17
0x7C080600, // 000F CALL R2 3 0x780A0000, // 000F JMPF R2 #0011
0x4C0C0000, // 0010 LDNIL R3 0x90020710, // 0010 SETMBR R0 K3 K16
0x200C0403, // 0011 NE R3 R2 R3 0x80000000, // 0011 RET 0
0x780E0003, // 0012 JMPF R3 #0017
0x8C0C0501, // 0013 GETMET R3 R2 K1
0x5814000B, // 0014 LDCONST R5 K11
0x7C0C0400, // 0015 CALL R3 2
0x5C080600, // 0016 MOVE R2 R3
0x4C0C0000, // 0017 LDNIL R3
0x200C0403, // 0018 NE R3 R2 R3
0x780E000D, // 0019 JMPF R3 #0028
0x8C0C050C, // 001A GETMET R3 R2 K12
0x5C140200, // 001B MOVE R5 R1
0x7C0C0400, // 001C CALL R3 2
0x780E0009, // 001D JMPF R3 #0028
0x8C0C0501, // 001E GETMET R3 R2 K1
0x5C140200, // 001F MOVE R5 R1
0x7C0C0400, // 0020 CALL R3 2
0x1C0C070D, // 0021 EQ R3 R3 K13
0x8810010E, // 0022 GETMBR R4 R0 K14
0x20100803, // 0023 NE R4 R4 R3
0x78120001, // 0024 JMPF R4 #0027
0x8C10010F, // 0025 GETMET R4 R0 K15
0x7C100200, // 0026 CALL R4 1
0x90021C03, // 0027 SETMBR R0 K14 R3
0x80000000, // 0028 RET 0
}) })
) )
); );
@ -178,12 +222,12 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow, /* name */
/******************************************************************** /********************************************************************
** Solidified function: init ** Solidified function: update_virtual
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Boolean_init, /* name */ be_local_closure(class_Matter_Plugin_Sensor_Boolean_update_virtual, /* name */
be_nested_proto( be_nested_proto(
9, /* nstack */ 10, /* nstack */
4, /* argc */ 2, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
NULL, /* no upvals */ NULL, /* no upvals */
@ -191,20 +235,27 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_init, /* name */
NULL, /* no sub protos */ NULL, /* no sub protos */
1, /* has constants */ 1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor_Boolean, /* shared constants */
be_str_weak(init), be_str_weak(update_virtual),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[11]) { /* code */ ( &(const binstruction[18]) { /* code */
0x60100003, // 0000 GETGBL R4 G3 0x8C080112, // 0000 GETMET R2 R0 K18
0x5C140000, // 0001 MOVE R5 R0 0x5C100200, // 0001 MOVE R4 R1
0x7C100200, // 0002 CALL R4 1 0x88140113, // 0002 GETMBR R5 R0 K19
0x8C100910, // 0003 GETMET R4 R4 K16 0x8818010B, // 0003 GETMBR R6 R0 K11
0x5C180200, // 0004 MOVE R6 R1 0x601C0017, // 0004 GETGBL R7 G23
0x5C1C0400, // 0005 MOVE R7 R2 0x4C200000, // 0005 LDNIL R8
0x5C200600, // 0006 MOVE R8 R3 0x4C240000, // 0006 LDNIL R9
0x7C100800, // 0007 CALL R4 4 0x7C080E00, // 0007 CALL R2 7
0x50100000, // 0008 LDBOOL R4 0 0 0x90021602, // 0008 SETMBR R0 K11 R2
0x90021C04, // 0009 SETMBR R0 K14 R4 0x8C08010C, // 0009 GETMET R2 R0 K12
0x80000000, // 000A RET 0 0x7C080200, // 000A CALL R2 1
0x60080003, // 000B GETGBL R2 G3
0x5C0C0000, // 000C MOVE R3 R0
0x7C080200, // 000D CALL R2 1
0x8C080514, // 000E GETMET R2 R2 K20
0x5C100200, // 000F MOVE R4 R1
0x7C080400, // 0010 CALL R2 2
0x80000000, // 0011 RET 0
}) })
) )
); );
@ -232,27 +283,27 @@ be_local_closure(class_Matter_Plugin_Sensor_Boolean_parse_status, /* name */
0x1C0C0403, // 0001 EQ R3 R2 R3 0x1C0C0403, // 0001 EQ R3 R2 R3
0x780E0015, // 0002 JMPF R3 #0019 0x780E0015, // 0002 JMPF R3 #0019
0x500C0000, // 0003 LDBOOL R3 0 0 0x500C0000, // 0003 LDBOOL R3 0 0
0x8C100301, // 0004 GETMET R4 R1 K1 0x8C100307, // 0004 GETMET R4 R1 K7
0x60180008, // 0005 GETGBL R6 G8 0x60180008, // 0005 GETGBL R6 G8
0x881C0100, // 0006 GETMBR R7 R0 K0 0x881C0103, // 0006 GETMBR R7 R0 K3
0x7C180200, // 0007 CALL R6 1 0x7C180200, // 0007 CALL R6 1
0x001A0E06, // 0008 ADD R6 K7 R6 0x001A0406, // 0008 ADD R6 K2 R6
0x7C100400, // 0009 CALL R4 2 0x7C100400, // 0009 CALL R4 2
0x1C10090D, // 000A EQ R4 R4 K13 0x1C10090A, // 000A EQ R4 R4 K10
0x5C0C0800, // 000B MOVE R3 R4 0x5C0C0800, // 000B MOVE R3 R4
0x8810010E, // 000C GETMBR R4 R0 K14 0x8810010B, // 000C GETMBR R4 R0 K11
0x4C140000, // 000D LDNIL R5 0x4C140000, // 000D LDNIL R5
0x20100805, // 000E NE R4 R4 R5 0x20100805, // 000E NE R4 R4 R5
0x78120007, // 000F JMPF R4 #0018 0x78120007, // 000F JMPF R4 #0018
0x8810010E, // 0010 GETMBR R4 R0 K14 0x8810010B, // 0010 GETMBR R4 R0 K11
0x60140017, // 0011 GETGBL R5 G23 0x60140017, // 0011 GETGBL R5 G23
0x5C180600, // 0012 MOVE R6 R3 0x5C180600, // 0012 MOVE R6 R3
0x7C140200, // 0013 CALL R5 1 0x7C140200, // 0013 CALL R5 1
0x20100805, // 0014 NE R4 R4 R5 0x20100805, // 0014 NE R4 R4 R5
0x78120001, // 0015 JMPF R4 #0018 0x78120001, // 0015 JMPF R4 #0018
0x8C10010F, // 0016 GETMET R4 R0 K15 0x8C10010C, // 0016 GETMET R4 R0 K12
0x7C100200, // 0017 CALL R4 1 0x7C100200, // 0017 CALL R4 1
0x90021C03, // 0018 SETMBR R0 K14 R3 0x90021603, // 0018 SETMBR R0 K11 R3
0x80000000, // 0019 RET 0 0x80000000, // 0019 RET 0
}) })
) )
@ -267,19 +318,20 @@ extern const bclass be_class_Matter_Plugin_Device;
be_local_class(Matter_Plugin_Sensor_Boolean, be_local_class(Matter_Plugin_Sensor_Boolean,
2, 2,
&be_class_Matter_Plugin_Device, &be_class_Matter_Plugin_Device,
be_nested_map(11, be_nested_map(12,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(shadow_bool_value, -1), be_const_var(1) },
{ be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Switch_X3Cx_X3E_X20number) },
{ be_const_key_weak(parse_status, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_parse_status_closure) },
{ be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_value_updated_closure) },
{ be_const_key_weak(tasmota_switch_index, -1), be_const_var(0) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(class_Matter_Plugin_Sensor_Boolean__X3Clambda_X3E_closure) },
{ be_const_key_weak(update_shadow, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow_closure) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
{ be_const_key_weak(UPDATE_TIME, -1), be_const_int(750) }, { be_const_key_weak(UPDATE_TIME, -1), be_const_int(750) },
{ be_const_key_weak(init, 8), be_const_closure(class_Matter_Plugin_Sensor_Boolean_init_closure) }, { be_const_key_weak(update_shadow, 6), be_const_closure(class_Matter_Plugin_Sensor_Boolean_update_shadow_closure) },
{ be_const_key_weak(parse_configuration, 2), be_const_closure(class_Matter_Plugin_Sensor_Boolean_parse_configuration_closure) }, { be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_value_updated_closure) },
{ be_const_key_weak(init, 5), be_const_closure(class_Matter_Plugin_Sensor_Boolean_init_closure) },
{ be_const_key_weak(ARG_TYPE, -1), be_const_static_closure(class_Matter_Plugin_Sensor_Boolean__X3Clambda_X3E_closure) },
{ be_const_key_weak(parse_status, 11), be_const_closure(class_Matter_Plugin_Sensor_Boolean_parse_status_closure) },
{ be_const_key_weak(parse_configuration, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_parse_configuration_closure) },
{ be_const_key_weak(update_virtual, -1), be_const_closure(class_Matter_Plugin_Sensor_Boolean_update_virtual_closure) },
{ be_const_key_weak(shadow_bool_value, 7), be_const_var(1) },
{ be_const_key_weak(ARG_HINT, -1), be_nested_str_weak(Switch_X3Cx_X3E_X20number) },
{ be_const_key_weak(tasmota_switch_index, -1), be_const_var(0) },
{ be_const_key_weak(ARG, -1), be_nested_str_weak(switch) },
})), })),
be_str_weak(Matter_Plugin_Sensor_Boolean) be_str_weak(Matter_Plugin_Sensor_Boolean)
); );

View File

@ -3,8 +3,8 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_GenericSwitch_Btn' ktab size: 24, total: 35 (saved 88 bytes) // compact class 'Matter_Plugin_Sensor_GenericSwitch_Btn' ktab size: 25, total: 36 (saved 88 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_GenericSwitch_Btn[24] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_GenericSwitch_Btn[25] = {
/* K0 */ be_nested_str_weak(matter), /* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(TLV), /* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(cluster), /* K2 */ be_nested_str_weak(cluster),
@ -19,16 +19,17 @@ static const bvalue be_ktab_class_Matter_Plugin_Sensor_GenericSwitch_Btn[24] = {
/* K11 */ be_nested_str_weak(U4), /* K11 */ be_nested_str_weak(U4),
/* K12 */ be_nested_str_weak(read_attribute), /* K12 */ be_nested_str_weak(read_attribute),
/* K13 */ be_nested_str_weak(attribute_updated), /* K13 */ be_nested_str_weak(attribute_updated),
/* K14 */ be_nested_str_weak(tasmota_switch_index), /* K14 */ be_nested_str_weak(parse_configuration),
/* K15 */ be_nested_str_weak(find), /* K15 */ be_nested_str_weak(tasmota_switch_index),
/* K16 */ be_nested_str_weak(ARG), /* K16 */ be_nested_str_weak(find),
/* K17 */ be_nested_str_weak(_X2C_X22Switch_X22_X3A_X25s), /* K17 */ be_nested_str_weak(ARG),
/* K18 */ be_nested_str_weak(shadow_onoff), /* K18 */ be_nested_str_weak(_X2C_X22Switch_X22_X3A_X25s),
/* K19 */ be_nested_str_weak(set_position), /* K19 */ be_nested_str_weak(shadow_onoff),
/* K20 */ be_nested_str_weak(publish_event), /* K20 */ be_nested_str_weak(set_position),
/* K21 */ be_nested_str_weak(EVENT_INFO), /* K21 */ be_nested_str_weak(publish_event),
/* K22 */ be_nested_str_weak(Matter_TLV_item), /* K22 */ be_nested_str_weak(EVENT_INFO),
/* K23 */ be_const_int(3), /* K23 */ be_nested_str_weak(Matter_TLV_item),
/* K24 */ be_const_int(3),
}; };
@ -180,19 +181,25 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_parse_configuratio
&be_ktab_class_Matter_Plugin_Sensor_GenericSwitch_Btn, /* shared constants */ &be_ktab_class_Matter_Plugin_Sensor_GenericSwitch_Btn, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[12]) { /* code */ ( &(const binstruction[18]) { /* code */
0x60080009, // 0000 GETGBL R2 G9 0x60080003, // 0000 GETGBL R2 G3
0x8C0C030F, // 0001 GETMET R3 R1 K15 0x5C0C0000, // 0001 MOVE R3 R0
0x88140110, // 0002 GETMBR R5 R0 K16 0x7C080200, // 0002 CALL R2 1
0x58180008, // 0003 LDCONST R6 K8 0x8C08050E, // 0003 GETMET R2 R2 K14
0x7C0C0600, // 0004 CALL R3 3 0x5C100200, // 0004 MOVE R4 R1
0x7C080200, // 0005 CALL R2 1 0x7C080400, // 0005 CALL R2 2
0x90021C02, // 0006 SETMBR R0 K14 R2 0x60080009, // 0006 GETGBL R2 G9
0x8808010E, // 0007 GETMBR R2 R0 K14 0x8C0C0310, // 0007 GETMET R3 R1 K16
0x18080504, // 0008 LE R2 R2 K4 0x88140111, // 0008 GETMBR R5 R0 K17
0x780A0000, // 0009 JMPF R2 #000B 0x58180008, // 0009 LDCONST R6 K8
0x90021D08, // 000A SETMBR R0 K14 K8 0x7C0C0600, // 000A CALL R3 3
0x80000000, // 000B RET 0 0x7C080200, // 000B CALL R2 1
0x90021E02, // 000C SETMBR R0 K15 R2
0x8808010F, // 000D GETMBR R2 R0 K15
0x18080504, // 000E LE R2 R2 K4
0x780A0000, // 000F JMPF R2 #0011
0x90021F08, // 0010 SETMBR R0 K15 K8
0x80000000, // 0011 RET 0
}) })
) )
); );
@ -217,9 +224,9 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_append_state_json,
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */ ( &(const binstruction[ 7]) { /* code */
0x60040018, // 0000 GETGBL R1 G24 0x60040018, // 0000 GETGBL R1 G24
0x58080011, // 0001 LDCONST R2 K17 0x58080012, // 0001 LDCONST R2 K18
0x600C0009, // 0002 GETGBL R3 G9 0x600C0009, // 0002 GETGBL R3 G9
0x88100112, // 0003 GETMBR R4 R0 K18 0x88100113, // 0003 GETMBR R4 R0 K19
0x7C0C0200, // 0004 CALL R3 1 0x7C0C0200, // 0004 CALL R3 1
0x7C040400, // 0005 CALL R1 2 0x7C040400, // 0005 CALL R1 2
0x80040200, // 0006 RET 1 R1 0x80040200, // 0006 RET 1 R1
@ -250,20 +257,20 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x74160001, // 0001 JMPT R5 #0004 0x74160001, // 0001 JMPT R5 #0004
0x1C140508, // 0002 EQ R5 R2 K8 0x1C140508, // 0002 EQ R5 R2 K8
0x78160002, // 0003 JMPF R5 #0007 0x78160002, // 0003 JMPF R5 #0007
0x8C140113, // 0004 GETMET R5 R0 K19 0x8C140114, // 0004 GETMET R5 R0 K20
0x5C1C0600, // 0005 MOVE R7 R3 0x5C1C0600, // 0005 MOVE R7 R3
0x7C140400, // 0006 CALL R5 2 0x7C140400, // 0006 CALL R5 2
0x1C140508, // 0007 EQ R5 R2 K8 0x1C140508, // 0007 EQ R5 R2 K8
0x78160040, // 0008 JMPF R5 #004A 0x78160040, // 0008 JMPF R5 #004A
0x780E0010, // 0009 JMPF R3 #001B 0x780E0010, // 0009 JMPF R3 #001B
0x8C140114, // 000A GETMET R5 R0 K20 0x8C140115, // 000A GETMET R5 R0 K21
0x541E003A, // 000B LDINT R7 59 0x541E003A, // 000B LDINT R7 59
0x58200008, // 000C LDCONST R8 K8 0x58200008, // 000C LDCONST R8 K8
0xB8260000, // 000D GETNGBL R9 K0 0xB8260000, // 000D GETNGBL R9 K0
0x88241315, // 000E GETMBR R9 R9 K21 0x88241316, // 000E GETMBR R9 R9 K22
0xB82A0000, // 000F GETNGBL R10 K0 0xB82A0000, // 000F GETNGBL R10 K0
0x88281501, // 0010 GETMBR R10 R10 K1 0x88281501, // 0010 GETMBR R10 R10 K1
0x8C281516, // 0011 GETMET R10 R10 K22 0x8C281517, // 0011 GETMET R10 R10 K23
0x7C280200, // 0012 CALL R10 1 0x7C280200, // 0012 CALL R10 1
0x8C281505, // 0013 GETMET R10 R10 K5 0x8C281505, // 0013 GETMET R10 R10 K5
0xB8320000, // 0014 GETNGBL R12 K0 0xB8320000, // 0014 GETNGBL R12 K0
@ -273,14 +280,14 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x7C280600, // 0018 CALL R10 3 0x7C280600, // 0018 CALL R10 3
0x7C140A00, // 0019 CALL R5 5 0x7C140A00, // 0019 CALL R5 5
0x7002000F, // 001A JMP #002B 0x7002000F, // 001A JMP #002B
0x8C140114, // 001B GETMET R5 R0 K20 0x8C140115, // 001B GETMET R5 R0 K21
0x541E003A, // 001C LDINT R7 59 0x541E003A, // 001C LDINT R7 59
0x58200017, // 001D LDCONST R8 K23 0x58200018, // 001D LDCONST R8 K24
0xB8260000, // 001E GETNGBL R9 K0 0xB8260000, // 001E GETNGBL R9 K0
0x88241315, // 001F GETMBR R9 R9 K21 0x88241316, // 001F GETMBR R9 R9 K22
0xB82A0000, // 0020 GETNGBL R10 K0 0xB82A0000, // 0020 GETNGBL R10 K0
0x88281501, // 0021 GETMBR R10 R10 K1 0x88281501, // 0021 GETMBR R10 R10 K1
0x8C281516, // 0022 GETMET R10 R10 K22 0x8C281517, // 0022 GETMET R10 R10 K23
0x7C280200, // 0023 CALL R10 1 0x7C280200, // 0023 CALL R10 1
0x8C281505, // 0024 GETMET R10 R10 K5 0x8C281505, // 0024 GETMET R10 R10 K5
0xB8320000, // 0025 GETNGBL R12 K0 0xB8320000, // 0025 GETNGBL R12 K0
@ -293,14 +300,14 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x7816001B, // 002C JMPF R5 #0049 0x7816001B, // 002C JMPF R5 #0049
0x24140904, // 002D GT R5 R4 K4 0x24140904, // 002D GT R5 R4 K4
0x78160019, // 002E JMPF R5 #0049 0x78160019, // 002E JMPF R5 #0049
0x8C140114, // 002F GETMET R5 R0 K20 0x8C140115, // 002F GETMET R5 R0 K21
0x541E003A, // 0030 LDINT R7 59 0x541E003A, // 0030 LDINT R7 59
0x54220004, // 0031 LDINT R8 5 0x54220004, // 0031 LDINT R8 5
0xB8260000, // 0032 GETNGBL R9 K0 0xB8260000, // 0032 GETNGBL R9 K0
0x88241315, // 0033 GETMBR R9 R9 K21 0x88241316, // 0033 GETMBR R9 R9 K22
0xB82A0000, // 0034 GETNGBL R10 K0 0xB82A0000, // 0034 GETNGBL R10 K0
0x88281501, // 0035 GETMBR R10 R10 K1 0x88281501, // 0035 GETMBR R10 R10 K1
0x8C281516, // 0036 GETMET R10 R10 K22 0x8C281517, // 0036 GETMET R10 R10 K23
0x7C280200, // 0037 CALL R10 1 0x7C280200, // 0037 CALL R10 1
0x8C281505, // 0038 GETMET R10 R10 K5 0x8C281505, // 0038 GETMET R10 R10 K5
0xB8320000, // 0039 GETNGBL R12 K0 0xB8320000, // 0039 GETNGBL R12 K0
@ -310,7 +317,7 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x7C280600, // 003D CALL R10 3 0x7C280600, // 003D CALL R10 3
0xB82E0000, // 003E GETNGBL R11 K0 0xB82E0000, // 003E GETNGBL R11 K0
0x882C1701, // 003F GETMBR R11 R11 K1 0x882C1701, // 003F GETMBR R11 R11 K1
0x8C2C1716, // 0040 GETMET R11 R11 K22 0x8C2C1717, // 0040 GETMET R11 R11 K23
0x7C2C0200, // 0041 CALL R11 1 0x7C2C0200, // 0041 CALL R11 1
0x8C2C1705, // 0042 GETMET R11 R11 K5 0x8C2C1705, // 0042 GETMET R11 R11 K5
0xB8360000, // 0043 GETNGBL R13 K0 0xB8360000, // 0043 GETNGBL R13 K0
@ -324,14 +331,14 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x7816001B, // 004B JMPF R5 #0068 0x7816001B, // 004B JMPF R5 #0068
0x24140904, // 004C GT R5 R4 K4 0x24140904, // 004C GT R5 R4 K4
0x78160019, // 004D JMPF R5 #0068 0x78160019, // 004D JMPF R5 #0068
0x8C140114, // 004E GETMET R5 R0 K20 0x8C140115, // 004E GETMET R5 R0 K21
0x541E003A, // 004F LDINT R7 59 0x541E003A, // 004F LDINT R7 59
0x54220005, // 0050 LDINT R8 6 0x54220005, // 0050 LDINT R8 6
0xB8260000, // 0051 GETNGBL R9 K0 0xB8260000, // 0051 GETNGBL R9 K0
0x88241315, // 0052 GETMBR R9 R9 K21 0x88241316, // 0052 GETMBR R9 R9 K22
0xB82A0000, // 0053 GETNGBL R10 K0 0xB82A0000, // 0053 GETNGBL R10 K0
0x88281501, // 0054 GETMBR R10 R10 K1 0x88281501, // 0054 GETMBR R10 R10 K1
0x8C281516, // 0055 GETMET R10 R10 K22 0x8C281517, // 0055 GETMET R10 R10 K23
0x7C280200, // 0056 CALL R10 1 0x7C280200, // 0056 CALL R10 1
0x8C281505, // 0057 GETMET R10 R10 K5 0x8C281505, // 0057 GETMET R10 R10 K5
0xB8320000, // 0058 GETNGBL R12 K0 0xB8320000, // 0058 GETNGBL R12 K0
@ -341,7 +348,7 @@ be_local_closure(class_Matter_Plugin_Sensor_GenericSwitch_Btn_button_handler,
0x7C280600, // 005C CALL R10 3 0x7C280600, // 005C CALL R10 3
0xB82E0000, // 005D GETNGBL R11 K0 0xB82E0000, // 005D GETNGBL R11 K0
0x882C1701, // 005E GETMBR R11 R11 K1 0x882C1701, // 005E GETMBR R11 R11 K1
0x8C2C1716, // 005F GETMET R11 R11 K22 0x8C2C1717, // 005F GETMET R11 R11 K23
0x7C2C0200, // 0060 CALL R11 1 0x7C2C0200, // 0060 CALL R11 1
0x8C2C1705, // 0061 GETMET R11 R11 K5 0x8C2C1705, // 0061 GETMET R11 R11 K5
0xB8360000, // 0062 GETNGBL R13 K0 0xB8360000, // 0062 GETNGBL R13 K0

View File

@ -3,55 +3,57 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Shutter' ktab size: 47, total: 78 (saved 248 bytes) // compact class 'Matter_Plugin_Shutter' ktab size: 49, total: 80 (saved 248 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Shutter[47] = { static const bvalue be_ktab_class_Matter_Plugin_Shutter[49] = {
/* K0 */ be_nested_str_weak(tasmota_shutter_index), /* K0 */ be_nested_str_weak(parse_configuration),
/* K1 */ be_nested_str_weak(find), /* K1 */ be_nested_str_weak(tasmota_shutter_index),
/* K2 */ be_nested_str_weak(ARG), /* K2 */ be_nested_str_weak(find),
/* K3 */ be_const_int(0), /* K3 */ be_nested_str_weak(ARG),
/* K4 */ be_nested_str_weak(shadow_shutter_inverted), /* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(light), /* K5 */ be_nested_str_weak(shadow_shutter_inverted),
/* K6 */ be_nested_str_weak(matter), /* K6 */ be_nested_str_weak(light),
/* K7 */ be_nested_str_weak(TLV), /* K7 */ be_nested_str_weak(matter),
/* K8 */ be_nested_str_weak(cluster), /* K8 */ be_nested_str_weak(TLV),
/* K9 */ be_nested_str_weak(command), /* K9 */ be_nested_str_weak(cluster),
/* K10 */ be_nested_str_weak(update_shadow_lazy), /* K10 */ be_nested_str_weak(command),
/* K11 */ be_nested_str_weak(tasmota), /* K11 */ be_nested_str_weak(update_shadow_lazy),
/* K12 */ be_nested_str_weak(cmd), /* K12 */ be_nested_str_weak(tasmota),
/* K13 */ be_nested_str_weak(ShutterStopOpen), /* K13 */ be_nested_str_weak(cmd),
/* K14 */ be_const_int(1), /* K14 */ be_nested_str_weak(ShutterStopOpen),
/* K15 */ be_nested_str_weak(update_shadow), /* K15 */ be_const_int(1),
/* K16 */ be_nested_str_weak(ShutterStopClose), /* K16 */ be_nested_str_weak(update_shadow),
/* K17 */ be_const_int(2), /* K17 */ be_nested_str_weak(ShutterStopClose),
/* K18 */ be_nested_str_weak(ShutterStop), /* K18 */ be_const_int(2),
/* K19 */ be_nested_str_weak(log), /* K19 */ be_nested_str_weak(ShutterStop),
/* K20 */ be_nested_str_weak(MTR_X3A_X20Tilt_X20_X3D_X20), /* K20 */ be_nested_str_weak(log),
/* K21 */ be_nested_str_weak(findsubval), /* K21 */ be_nested_str_weak(MTR_X3A_X20Tilt_X20_X3D_X20),
/* K22 */ be_nested_str_weak(ShutterPosition), /* K22 */ be_nested_str_weak(findsubval),
/* K23 */ be_nested_str_weak(_X20), /* K23 */ be_nested_str_weak(ShutterPosition),
/* K24 */ be_nested_str_weak(pos_X25_X3A), /* K24 */ be_nested_str_weak(_X20),
/* K25 */ be_nested_str_weak(invoke_request), /* K25 */ be_nested_str_weak(pos_X25_X3A),
/* K26 */ be_nested_str_weak(attribute), /* K26 */ be_nested_str_weak(invoke_request),
/* K27 */ be_nested_str_weak(update_inverted), /* K27 */ be_nested_str_weak(attribute),
/* K28 */ be_nested_str_weak(set), /* K28 */ be_nested_str_weak(update_inverted),
/* K29 */ be_nested_str_weak(U1), /* K29 */ be_nested_str_weak(set),
/* K30 */ be_nested_str_weak(U2), /* K30 */ be_nested_str_weak(U1),
/* K31 */ be_nested_str_weak(shadow_shutter_pos), /* K31 */ be_nested_str_weak(U2),
/* K32 */ be_nested_str_weak(shadow_shutter_direction), /* K32 */ be_nested_str_weak(shadow_shutter_pos),
/* K33 */ be_nested_str_weak(shadow_shutter_target), /* K33 */ be_nested_str_weak(set_or_nil),
/* K34 */ be_nested_str_weak(read_attribute), /* K34 */ be_nested_str_weak(shadow_shutter_direction),
/* K35 */ be_nested_str_weak(Shutter), /* K35 */ be_nested_str_weak(shadow_shutter_target),
/* K36 */ be_nested_str_weak(contains), /* K36 */ be_nested_str_weak(read_attribute),
/* K37 */ be_nested_str_weak(Position), /* K37 */ be_nested_str_weak(Shutter),
/* K38 */ be_nested_str_weak(attribute_updated), /* K38 */ be_nested_str_weak(contains),
/* K39 */ be_nested_str_weak(Direction), /* K39 */ be_nested_str_weak(Position),
/* K40 */ be_nested_str_weak(Target), /* K40 */ be_nested_str_weak(attribute_updated),
/* K41 */ be_nested_str_weak(Status_X2013), /* K41 */ be_nested_str_weak(Direction),
/* K42 */ be_nested_str_weak(StatusSHT), /* K42 */ be_nested_str_weak(Target),
/* K43 */ be_nested_str_weak(SHT), /* K43 */ be_nested_str_weak(Status_X2013),
/* K44 */ be_nested_str_weak(Opt), /* K44 */ be_nested_str_weak(StatusSHT),
/* K45 */ be_nested_str_weak(VIRTUAL), /* K45 */ be_nested_str_weak(SHT),
/* K46 */ be_nested_str_weak(parse_sensors), /* K46 */ be_nested_str_weak(Opt),
/* K47 */ be_nested_str_weak(VIRTUAL),
/* K48 */ be_nested_str_weak(parse_sensors),
}; };
@ -73,19 +75,25 @@ be_local_closure(class_Matter_Plugin_Shutter_parse_configuration, /* name */
&be_ktab_class_Matter_Plugin_Shutter, /* shared constants */ &be_ktab_class_Matter_Plugin_Shutter, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[12]) { /* code */ ( &(const binstruction[18]) { /* code */
0x8C080301, // 0000 GETMET R2 R1 K1 0x60080003, // 0000 GETGBL R2 G3
0x88100102, // 0001 GETMBR R4 R0 K2 0x5C0C0000, // 0001 MOVE R3 R0
0x7C080400, // 0002 CALL R2 2 0x7C080200, // 0002 CALL R2 1
0x90020002, // 0003 SETMBR R0 K0 R2 0x8C080500, // 0003 GETMET R2 R2 K0
0x88080100, // 0004 GETMBR R2 R0 K0 0x5C100200, // 0004 MOVE R4 R1
0x4C0C0000, // 0005 LDNIL R3 0x7C080400, // 0005 CALL R2 2
0x1C080403, // 0006 EQ R2 R2 R3 0x8C080302, // 0006 GETMET R2 R1 K2
0x780A0000, // 0007 JMPF R2 #0009 0x88100103, // 0007 GETMBR R4 R0 K3
0x90020103, // 0008 SETMBR R0 K0 K3 0x7C080400, // 0008 CALL R2 2
0x5409FFFE, // 0009 LDINT R2 -1 0x90020202, // 0009 SETMBR R0 K1 R2
0x90020802, // 000A SETMBR R0 K4 R2 0x88080101, // 000A GETMBR R2 R0 K1
0x80000000, // 000B RET 0 0x4C0C0000, // 000B LDNIL R3
0x1C080403, // 000C EQ R2 R2 R3
0x780A0000, // 000D JMPF R2 #000F
0x90020304, // 000E SETMBR R0 K1 K4
0x5409FFFE, // 000F LDINT R2 -1
0x90020A02, // 0010 SETMBR R0 K5 R2
0x80000000, // 0011 RET 0
}) })
) )
); );
@ -109,60 +117,60 @@ be_local_closure(class_Matter_Plugin_Shutter_invoke_request, /* name */
be_str_weak(invoke_request), be_str_weak(invoke_request),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[115]) { /* code */ ( &(const binstruction[115]) { /* code */
0xA4120A00, // 0000 IMPORT R4 K5 0xA4120C00, // 0000 IMPORT R4 K6
0xB8160C00, // 0001 GETNGBL R5 K6 0xB8160E00, // 0001 GETNGBL R5 K7
0x88140B07, // 0002 GETMBR R5 R5 K7 0x88140B08, // 0002 GETMBR R5 R5 K8
0x88180708, // 0003 GETMBR R6 R3 K8 0x88180709, // 0003 GETMBR R6 R3 K9
0x881C0709, // 0004 GETMBR R7 R3 K9 0x881C070A, // 0004 GETMBR R7 R3 K10
0x54220101, // 0005 LDINT R8 258 0x54220101, // 0005 LDINT R8 258
0x1C200C08, // 0006 EQ R8 R6 R8 0x1C200C08, // 0006 EQ R8 R6 R8
0x78220060, // 0007 JMPF R8 #0069 0x78220060, // 0007 JMPF R8 #0069
0x8C20010A, // 0008 GETMET R8 R0 K10 0x8C20010B, // 0008 GETMET R8 R0 K11
0x7C200200, // 0009 CALL R8 1 0x7C200200, // 0009 CALL R8 1
0x1C200F03, // 000A EQ R8 R7 K3 0x1C200F04, // 000A EQ R8 R7 K4
0x7822000D, // 000B JMPF R8 #001A 0x7822000D, // 000B JMPF R8 #001A
0xB8221600, // 000C GETNGBL R8 K11 0xB8221800, // 000C GETNGBL R8 K12
0x8C20110C, // 000D GETMET R8 R8 K12 0x8C20110D, // 000D GETMET R8 R8 K13
0x60280008, // 000E GETGBL R10 G8 0x60280008, // 000E GETGBL R10 G8
0x882C0100, // 000F GETMBR R11 R0 K0 0x882C0101, // 000F GETMBR R11 R0 K1
0x002C170E, // 0010 ADD R11 R11 K14 0x002C170F, // 0010 ADD R11 R11 K15
0x7C280200, // 0011 CALL R10 1 0x7C280200, // 0011 CALL R10 1
0x002A1A0A, // 0012 ADD R10 K13 R10 0x002A1C0A, // 0012 ADD R10 K14 R10
0x502C0200, // 0013 LDBOOL R11 1 0 0x502C0200, // 0013 LDBOOL R11 1 0
0x7C200600, // 0014 CALL R8 3 0x7C200600, // 0014 CALL R8 3
0x8C20010F, // 0015 GETMET R8 R0 K15 0x8C200110, // 0015 GETMET R8 R0 K16
0x7C200200, // 0016 CALL R8 1 0x7C200200, // 0016 CALL R8 1
0x50200200, // 0017 LDBOOL R8 1 0 0x50200200, // 0017 LDBOOL R8 1 0
0x80041000, // 0018 RET 1 R8 0x80041000, // 0018 RET 1 R8
0x7002004D, // 0019 JMP #0068 0x7002004D, // 0019 JMP #0068
0x1C200F0E, // 001A EQ R8 R7 K14 0x1C200F0F, // 001A EQ R8 R7 K15
0x7822000D, // 001B JMPF R8 #002A 0x7822000D, // 001B JMPF R8 #002A
0xB8221600, // 001C GETNGBL R8 K11 0xB8221800, // 001C GETNGBL R8 K12
0x8C20110C, // 001D GETMET R8 R8 K12 0x8C20110D, // 001D GETMET R8 R8 K13
0x60280008, // 001E GETGBL R10 G8 0x60280008, // 001E GETGBL R10 G8
0x882C0100, // 001F GETMBR R11 R0 K0 0x882C0101, // 001F GETMBR R11 R0 K1
0x002C170E, // 0020 ADD R11 R11 K14 0x002C170F, // 0020 ADD R11 R11 K15
0x7C280200, // 0021 CALL R10 1 0x7C280200, // 0021 CALL R10 1
0x002A200A, // 0022 ADD R10 K16 R10 0x002A220A, // 0022 ADD R10 K17 R10
0x502C0200, // 0023 LDBOOL R11 1 0 0x502C0200, // 0023 LDBOOL R11 1 0
0x7C200600, // 0024 CALL R8 3 0x7C200600, // 0024 CALL R8 3
0x8C20010F, // 0025 GETMET R8 R0 K15 0x8C200110, // 0025 GETMET R8 R0 K16
0x7C200200, // 0026 CALL R8 1 0x7C200200, // 0026 CALL R8 1
0x50200200, // 0027 LDBOOL R8 1 0 0x50200200, // 0027 LDBOOL R8 1 0
0x80041000, // 0028 RET 1 R8 0x80041000, // 0028 RET 1 R8
0x7002003D, // 0029 JMP #0068 0x7002003D, // 0029 JMP #0068
0x1C200F11, // 002A EQ R8 R7 K17 0x1C200F12, // 002A EQ R8 R7 K18
0x7822000D, // 002B JMPF R8 #003A 0x7822000D, // 002B JMPF R8 #003A
0xB8221600, // 002C GETNGBL R8 K11 0xB8221800, // 002C GETNGBL R8 K12
0x8C20110C, // 002D GETMET R8 R8 K12 0x8C20110D, // 002D GETMET R8 R8 K13
0x60280008, // 002E GETGBL R10 G8 0x60280008, // 002E GETGBL R10 G8
0x882C0100, // 002F GETMBR R11 R0 K0 0x882C0101, // 002F GETMBR R11 R0 K1
0x002C170E, // 0030 ADD R11 R11 K14 0x002C170F, // 0030 ADD R11 R11 K15
0x7C280200, // 0031 CALL R10 1 0x7C280200, // 0031 CALL R10 1
0x002A240A, // 0032 ADD R10 K18 R10 0x002A260A, // 0032 ADD R10 K19 R10
0x502C0200, // 0033 LDBOOL R11 1 0 0x502C0200, // 0033 LDBOOL R11 1 0
0x7C200600, // 0034 CALL R8 3 0x7C200600, // 0034 CALL R8 3
0x8C20010F, // 0035 GETMET R8 R0 K15 0x8C200110, // 0035 GETMET R8 R0 K16
0x7C200200, // 0036 CALL R8 1 0x7C200200, // 0036 CALL R8 1
0x50200200, // 0037 LDBOOL R8 1 0 0x50200200, // 0037 LDBOOL R8 1 0
0x80041000, // 0038 RET 1 R8 0x80041000, // 0038 RET 1 R8
@ -170,34 +178,34 @@ be_local_closure(class_Matter_Plugin_Shutter_invoke_request, /* name */
0x54220004, // 003A LDINT R8 5 0x54220004, // 003A LDINT R8 5
0x1C200E08, // 003B EQ R8 R7 R8 0x1C200E08, // 003B EQ R8 R7 R8
0x7822002A, // 003C JMPF R8 #0068 0x7822002A, // 003C JMPF R8 #0068
0xB8222600, // 003D GETNGBL R8 K19 0xB8222800, // 003D GETNGBL R8 K20
0x60240008, // 003E GETGBL R9 G8 0x60240008, // 003E GETGBL R9 G8
0x5C280400, // 003F MOVE R10 R2 0x5C280400, // 003F MOVE R10 R2
0x7C240200, // 0040 CALL R9 1 0x7C240200, // 0040 CALL R9 1
0x00262809, // 0041 ADD R9 K20 R9 0x00262A09, // 0041 ADD R9 K21 R9
0x58280011, // 0042 LDCONST R10 K17 0x58280012, // 0042 LDCONST R10 K18
0x7C200400, // 0043 CALL R8 2 0x7C200400, // 0043 CALL R8 2
0x8C200515, // 0044 GETMET R8 R2 K21 0x8C200516, // 0044 GETMET R8 R2 K22
0x58280003, // 0045 LDCONST R10 K3 0x58280004, // 0045 LDCONST R10 K4
0x7C200400, // 0046 CALL R8 2 0x7C200400, // 0046 CALL R8 2
0x4C240000, // 0047 LDNIL R9 0x4C240000, // 0047 LDNIL R9
0x20241009, // 0048 NE R9 R8 R9 0x20241009, // 0048 NE R9 R8 R9
0x7826001B, // 0049 JMPF R9 #0066 0x7826001B, // 0049 JMPF R9 #0066
0x54260063, // 004A LDINT R9 100 0x54260063, // 004A LDINT R9 100
0x0C201009, // 004B DIV R8 R8 R9 0x0C201009, // 004B DIV R8 R8 R9
0x88240104, // 004C GETMBR R9 R0 K4 0x88240105, // 004C GETMBR R9 R0 K5
0x1C241303, // 004D EQ R9 R9 K3 0x1C241304, // 004D EQ R9 R9 K4
0x78260001, // 004E JMPF R9 #0051 0x78260001, // 004E JMPF R9 #0051
0x54260063, // 004F LDINT R9 100 0x54260063, // 004F LDINT R9 100
0x04201208, // 0050 SUB R8 R9 R8 0x04201208, // 0050 SUB R8 R9 R8
0xB8261600, // 0051 GETNGBL R9 K11 0xB8261800, // 0051 GETNGBL R9 K12
0x8C24130C, // 0052 GETMET R9 R9 K12 0x8C24130D, // 0052 GETMET R9 R9 K13
0x602C0008, // 0053 GETGBL R11 G8 0x602C0008, // 0053 GETGBL R11 G8
0x88300100, // 0054 GETMBR R12 R0 K0 0x88300101, // 0054 GETMBR R12 R0 K1
0x0030190E, // 0055 ADD R12 R12 K14 0x0030190F, // 0055 ADD R12 R12 K15
0x7C2C0200, // 0056 CALL R11 1 0x7C2C0200, // 0056 CALL R11 1
0x002E2C0B, // 0057 ADD R11 K22 R11 0x002E2E0B, // 0057 ADD R11 K23 R11
0x002C1717, // 0058 ADD R11 R11 K23 0x002C1718, // 0058 ADD R11 R11 K24
0x60300008, // 0059 GETGBL R12 G8 0x60300008, // 0059 GETGBL R12 G8
0x5C341000, // 005A MOVE R13 R8 0x5C341000, // 005A MOVE R13 R8
0x7C300200, // 005B CALL R12 1 0x7C300200, // 005B CALL R12 1
@ -207,9 +215,9 @@ be_local_closure(class_Matter_Plugin_Shutter_invoke_request, /* name */
0x60240008, // 005F GETGBL R9 G8 0x60240008, // 005F GETGBL R9 G8
0x5C281000, // 0060 MOVE R10 R8 0x5C281000, // 0060 MOVE R10 R8
0x7C240200, // 0061 CALL R9 1 0x7C240200, // 0061 CALL R9 1
0x00263009, // 0062 ADD R9 K24 R9 0x00263209, // 0062 ADD R9 K25 R9
0x900E2609, // 0063 SETMBR R3 K19 R9 0x900E2809, // 0063 SETMBR R3 K20 R9
0x8C24010F, // 0064 GETMET R9 R0 K15 0x8C240110, // 0064 GETMET R9 R0 K16
0x7C240200, // 0065 CALL R9 1 0x7C240200, // 0065 CALL R9 1
0x50240200, // 0066 LDBOOL R9 1 0 0x50240200, // 0066 LDBOOL R9 1 0
0x80041200, // 0067 RET 1 R9 0x80041200, // 0067 RET 1 R9
@ -217,7 +225,7 @@ be_local_closure(class_Matter_Plugin_Shutter_invoke_request, /* name */
0x60200003, // 0069 GETGBL R8 G3 0x60200003, // 0069 GETGBL R8 G3
0x5C240000, // 006A MOVE R9 R0 0x5C240000, // 006A MOVE R9 R0
0x7C200200, // 006B CALL R8 1 0x7C200200, // 006B CALL R8 1
0x8C201119, // 006C GETMET R8 R8 K25 0x8C20111A, // 006C GETMET R8 R8 K26
0x5C280200, // 006D MOVE R10 R1 0x5C280200, // 006D MOVE R10 R1
0x5C2C0400, // 006E MOVE R11 R2 0x5C2C0400, // 006E MOVE R11 R2
0x5C300600, // 006F MOVE R12 R3 0x5C300600, // 006F MOVE R12 R3
@ -246,138 +254,152 @@ be_local_closure(class_Matter_Plugin_Shutter_read_attribute, /* name */
&be_ktab_class_Matter_Plugin_Shutter, /* shared constants */ &be_ktab_class_Matter_Plugin_Shutter, /* shared constants */
be_str_weak(read_attribute), be_str_weak(read_attribute),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[131]) { /* code */ ( &(const binstruction[145]) { /* code */
0xB8120C00, // 0000 GETNGBL R4 K6 0xB8120E00, // 0000 GETNGBL R4 K7
0x88100907, // 0001 GETMBR R4 R4 K7 0x88100908, // 0001 GETMBR R4 R4 K8
0x88140508, // 0002 GETMBR R5 R2 K8 0x88140509, // 0002 GETMBR R5 R2 K9
0x8818051A, // 0003 GETMBR R6 R2 K26 0x8818051B, // 0003 GETMBR R6 R2 K27
0x4C1C0000, // 0004 LDNIL R7 0x4C1C0000, // 0004 LDNIL R7
0x54220101, // 0005 LDINT R8 258 0x54220101, // 0005 LDINT R8 258
0x1C200A08, // 0006 EQ R8 R5 R8 0x1C200A08, // 0006 EQ R8 R5 R8
0x78220071, // 0007 JMPF R8 #007A 0x7822007F, // 0007 JMPF R8 #0088
0x8C20010A, // 0008 GETMET R8 R0 K10 0x8C20010B, // 0008 GETMET R8 R0 K11
0x7C200200, // 0009 CALL R8 1 0x7C200200, // 0009 CALL R8 1
0x8C20011B, // 000A GETMET R8 R0 K27 0x8C20011C, // 000A GETMET R8 R0 K28
0x7C200200, // 000B CALL R8 1 0x7C200200, // 000B CALL R8 1
0x1C200D03, // 000C EQ R8 R6 K3 0x1C200D04, // 000C EQ R8 R6 K4
0x78220005, // 000D JMPF R8 #0014 0x78220005, // 000D JMPF R8 #0014
0x8C20071C, // 000E GETMET R8 R3 K28 0x8C20071D, // 000E GETMET R8 R3 K29
0x8828091D, // 000F GETMBR R10 R4 K29 0x8828091E, // 000F GETMBR R10 R4 K30
0x542E00FE, // 0010 LDINT R11 255 0x542E00FE, // 0010 LDINT R11 255
0x7C200600, // 0011 CALL R8 3 0x7C200600, // 0011 CALL R8 3
0x80041000, // 0012 RET 1 R8 0x80041000, // 0012 RET 1 R8
0x70020065, // 0013 JMP #007A 0x70020073, // 0013 JMP #0088
0x54220004, // 0014 LDINT R8 5 0x54220004, // 0014 LDINT R8 5
0x1C200C08, // 0015 EQ R8 R6 R8 0x1C200C08, // 0015 EQ R8 R6 R8
0x78220005, // 0016 JMPF R8 #001D 0x78220005, // 0016 JMPF R8 #001D
0x8C20071C, // 0017 GETMET R8 R3 K28 0x8C20071D, // 0017 GETMET R8 R3 K29
0x8828091E, // 0018 GETMBR R10 R4 K30 0x8828091F, // 0018 GETMBR R10 R4 K31
0x582C0003, // 0019 LDCONST R11 K3 0x582C0004, // 0019 LDCONST R11 K4
0x7C200600, // 001A CALL R8 3 0x7C200600, // 001A CALL R8 3
0x80041000, // 001B RET 1 R8 0x80041000, // 001B RET 1 R8
0x7002005C, // 001C JMP #007A 0x7002006A, // 001C JMP #0088
0x54220006, // 001D LDINT R8 7 0x54220006, // 001D LDINT R8 7
0x1C200C08, // 001E EQ R8 R6 R8 0x1C200C08, // 001E EQ R8 R6 R8
0x78220006, // 001F JMPF R8 #0027 0x78220006, // 001F JMPF R8 #0027
0x8C20071C, // 0020 GETMET R8 R3 K28 0x8C20071D, // 0020 GETMET R8 R3 K29
0x8828091D, // 0021 GETMBR R10 R4 K29 0x8828091E, // 0021 GETMBR R10 R4 K30
0x542E0007, // 0022 LDINT R11 8 0x542E0007, // 0022 LDINT R11 8
0x002E1C0B, // 0023 ADD R11 K14 R11 0x002E1E0B, // 0023 ADD R11 K15 R11
0x7C200600, // 0024 CALL R8 3 0x7C200600, // 0024 CALL R8 3
0x80041000, // 0025 RET 1 R8 0x80041000, // 0025 RET 1 R8
0x70020052, // 0026 JMP #007A 0x70020060, // 0026 JMP #0088
0x5422000C, // 0027 LDINT R8 13 0x5422000C, // 0027 LDINT R8 13
0x1C200C08, // 0028 EQ R8 R6 R8 0x1C200C08, // 0028 EQ R8 R6 R8
0x78220005, // 0029 JMPF R8 #0030 0x78220005, // 0029 JMPF R8 #0030
0x8C20071C, // 002A GETMET R8 R3 K28 0x8C20071D, // 002A GETMET R8 R3 K29
0x8828091D, // 002B GETMBR R10 R4 K29 0x8828091E, // 002B GETMBR R10 R4 K30
0x542E00FE, // 002C LDINT R11 255 0x542E00FE, // 002C LDINT R11 255
0x7C200600, // 002D CALL R8 3 0x7C200600, // 002D CALL R8 3
0x80041000, // 002E RET 1 R8 0x80041000, // 002E RET 1 R8
0x70020049, // 002F JMP #007A 0x70020057, // 002F JMP #0088
0x5422000D, // 0030 LDINT R8 14 0x5422000D, // 0030 LDINT R8 14
0x1C200C08, // 0031 EQ R8 R6 R8 0x1C200C08, // 0031 EQ R8 R6 R8
0x78220013, // 0032 JMPF R8 #0047 0x78220017, // 0032 JMPF R8 #004B
0x88200104, // 0033 GETMBR R8 R0 K4 0x88200120, // 0033 GETMBR R8 R0 K32
0x1C201103, // 0034 EQ R8 R8 K3 0x4C240000, // 0034 LDNIL R9
0x78220006, // 0035 JMPF R8 #003D 0x20201009, // 0035 NE R8 R8 R9
0x54220063, // 0036 LDINT R8 100 0x7822000D, // 0036 JMPF R8 #0045
0x8824011F, // 0037 GETMBR R9 R0 K31 0x88200105, // 0037 GETMBR R8 R0 K5
0x04201009, // 0038 SUB R8 R8 R9 0x1C201104, // 0038 EQ R8 R8 K4
0x54260063, // 0039 LDINT R9 100 0x78220006, // 0039 JMPF R8 #0041
0x08201009, // 003A MUL R8 R8 R9 0x54220063, // 003A LDINT R8 100
0x5C1C1000, // 003B MOVE R7 R8 0x88240120, // 003B GETMBR R9 R0 K32
0x70020003, // 003C JMP #0041 0x04201009, // 003C SUB R8 R8 R9
0x8820011F, // 003D GETMBR R8 R0 K31 0x54260063, // 003D LDINT R9 100
0x54260063, // 003E LDINT R9 100 0x08201009, // 003E MUL R8 R8 R9
0x08201009, // 003F MUL R8 R8 R9 0x5C1C1000, // 003F MOVE R7 R8
0x5C1C1000, // 0040 MOVE R7 R8 0x70020003, // 0040 JMP #0045
0x8C20071C, // 0041 GETMET R8 R3 K28 0x88200120, // 0041 GETMBR R8 R0 K32
0x8828091E, // 0042 GETMBR R10 R4 K30 0x54260063, // 0042 LDINT R9 100
0x5C2C0E00, // 0043 MOVE R11 R7 0x08201009, // 0043 MUL R8 R8 R9
0x7C200600, // 0044 CALL R8 3 0x5C1C1000, // 0044 MOVE R7 R8
0x80041000, // 0045 RET 1 R8 0x8C200721, // 0045 GETMET R8 R3 K33
0x70020032, // 0046 JMP #007A 0x8828091F, // 0046 GETMBR R10 R4 K31
0x54220009, // 0047 LDINT R8 10 0x5C2C0E00, // 0047 MOVE R11 R7
0x1C200C08, // 0048 EQ R8 R6 R8 0x7C200600, // 0048 CALL R8 3
0x78220010, // 0049 JMPF R8 #005B 0x80041000, // 0049 RET 1 R8
0x88200120, // 004A GETMBR R8 R0 K32 0x7002003C, // 004A JMP #0088
0x1C201103, // 004B EQ R8 R8 K3 0x54220009, // 004B LDINT R8 10
0x78220001, // 004C JMPF R8 #004F 0x1C200C08, // 004C EQ R8 R6 R8
0x58200003, // 004D LDCONST R8 K3 0x78220016, // 004D JMPF R8 #0065
0x70020005, // 004E JMP #0055 0x4C200000, // 004E LDNIL R8
0x88200120, // 004F GETMBR R8 R0 K32 0x88240122, // 004F GETMBR R9 R0 K34
0x24201103, // 0050 GT R8 R8 K3 0x4C280000, // 0050 LDNIL R10
0x78220001, // 0051 JMPF R8 #0054 0x2024120A, // 0051 NE R9 R9 R10
0x5820000E, // 0052 LDCONST R8 K14 0x7826000B, // 0052 JMPF R9 #005F
0x70020000, // 0053 JMP #0055 0x88240122, // 0053 GETMBR R9 R0 K34
0x58200011, // 0054 LDCONST R8 K17 0x1C241304, // 0054 EQ R9 R9 K4
0x8C24071C, // 0055 GETMET R9 R3 K28 0x78260001, // 0055 JMPF R9 #0058
0x882C091D, // 0056 GETMBR R11 R4 K29 0x58240004, // 0056 LDCONST R9 K4
0x5C301000, // 0057 MOVE R12 R8 0x70020005, // 0057 JMP #005E
0x7C240600, // 0058 CALL R9 3 0x88240122, // 0058 GETMBR R9 R0 K34
0x80041200, // 0059 RET 1 R9 0x24241304, // 0059 GT R9 R9 K4
0x7002001E, // 005A JMP #007A 0x78260001, // 005A JMPF R9 #005D
0x5422000A, // 005B LDINT R8 11 0x5824000F, // 005B LDCONST R9 K15
0x1C200C08, // 005C EQ R8 R6 R8 0x70020000, // 005C JMP #005E
0x78220013, // 005D JMPF R8 #0072 0x58240012, // 005D LDCONST R9 K18
0x88200104, // 005E GETMBR R8 R0 K4 0x5C201200, // 005E MOVE R8 R9
0x1C201103, // 005F EQ R8 R8 K3 0x8C240721, // 005F GETMET R9 R3 K33
0x78220006, // 0060 JMPF R8 #0068 0x882C091E, // 0060 GETMBR R11 R4 K30
0x54220063, // 0061 LDINT R8 100 0x5C301000, // 0061 MOVE R12 R8
0x88240121, // 0062 GETMBR R9 R0 K33 0x7C240600, // 0062 CALL R9 3
0x04201009, // 0063 SUB R8 R8 R9 0x80041200, // 0063 RET 1 R9
0x54260063, // 0064 LDINT R9 100 0x70020022, // 0064 JMP #0088
0x08201009, // 0065 MUL R8 R8 R9 0x5422000A, // 0065 LDINT R8 11
0x5C1C1000, // 0066 MOVE R7 R8 0x1C200C08, // 0066 EQ R8 R6 R8
0x70020003, // 0067 JMP #006C 0x78220017, // 0067 JMPF R8 #0080
0x88200121, // 0068 GETMBR R8 R0 K33 0x88200123, // 0068 GETMBR R8 R0 K35
0x54260063, // 0069 LDINT R9 100 0x4C240000, // 0069 LDNIL R9
0x08201009, // 006A MUL R8 R8 R9 0x20201009, // 006A NE R8 R8 R9
0x5C1C1000, // 006B MOVE R7 R8 0x7822000D, // 006B JMPF R8 #007A
0x8C20071C, // 006C GETMET R8 R3 K28 0x88200105, // 006C GETMBR R8 R0 K5
0x8828091E, // 006D GETMBR R10 R4 K30 0x1C201104, // 006D EQ R8 R8 K4
0x5C2C0E00, // 006E MOVE R11 R7 0x78220006, // 006E JMPF R8 #0076
0x7C200600, // 006F CALL R8 3 0x54220063, // 006F LDINT R8 100
0x80041000, // 0070 RET 1 R8 0x88240123, // 0070 GETMBR R9 R0 K35
0x70020007, // 0071 JMP #007A 0x04201009, // 0071 SUB R8 R8 R9
0x54220016, // 0072 LDINT R8 23 0x54260063, // 0072 LDINT R9 100
0x1C200C08, // 0073 EQ R8 R6 R8 0x08201009, // 0073 MUL R8 R8 R9
0x78220004, // 0074 JMPF R8 #007A 0x5C1C1000, // 0074 MOVE R7 R8
0x8C20071C, // 0075 GETMET R8 R3 K28 0x70020003, // 0075 JMP #007A
0x8828091D, // 0076 GETMBR R10 R4 K29 0x88200123, // 0076 GETMBR R8 R0 K35
0x582C0003, // 0077 LDCONST R11 K3 0x54260063, // 0077 LDINT R9 100
0x7C200600, // 0078 CALL R8 3 0x08201009, // 0078 MUL R8 R8 R9
0x80041000, // 0079 RET 1 R8 0x5C1C1000, // 0079 MOVE R7 R8
0x60200003, // 007A GETGBL R8 G3 0x8C200721, // 007A GETMET R8 R3 K33
0x5C240000, // 007B MOVE R9 R0 0x8828091F, // 007B GETMBR R10 R4 K31
0x7C200200, // 007C CALL R8 1 0x5C2C0E00, // 007C MOVE R11 R7
0x8C201122, // 007D GETMET R8 R8 K34 0x7C200600, // 007D CALL R8 3
0x5C280200, // 007E MOVE R10 R1 0x80041000, // 007E RET 1 R8
0x5C2C0400, // 007F MOVE R11 R2 0x70020007, // 007F JMP #0088
0x5C300600, // 0080 MOVE R12 R3 0x54220016, // 0080 LDINT R8 23
0x7C200800, // 0081 CALL R8 4 0x1C200C08, // 0081 EQ R8 R6 R8
0x80041000, // 0082 RET 1 R8 0x78220004, // 0082 JMPF R8 #0088
0x8C20071D, // 0083 GETMET R8 R3 K29
0x8828091E, // 0084 GETMBR R10 R4 K30
0x582C0004, // 0085 LDCONST R11 K4
0x7C200600, // 0086 CALL R8 3
0x80041000, // 0087 RET 1 R8
0x60200003, // 0088 GETGBL R8 G3
0x5C240000, // 0089 MOVE R9 R0
0x7C200200, // 008A CALL R8 1
0x8C201124, // 008B GETMET R8 R8 K36
0x5C280200, // 008C MOVE R10 R1
0x5C2C0400, // 008D MOVE R11 R2
0x5C300600, // 008E MOVE R12 R3
0x7C200800, // 008F CALL R8 4
0x80041000, // 0090 RET 1 R8
}) })
) )
); );
@ -429,57 +451,57 @@ be_local_closure(class_Matter_Plugin_Shutter_parse_sensors, /* name */
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[53]) { /* code */ ( &(const binstruction[53]) { /* code */
0x60080008, // 0000 GETGBL R2 G8 0x60080008, // 0000 GETGBL R2 G8
0x880C0100, // 0001 GETMBR R3 R0 K0 0x880C0101, // 0001 GETMBR R3 R0 K1
0x000C070E, // 0002 ADD R3 R3 K14 0x000C070F, // 0002 ADD R3 R3 K15
0x7C080200, // 0003 CALL R2 1 0x7C080200, // 0003 CALL R2 1
0x000A4602, // 0004 ADD R2 K35 R2 0x000A4A02, // 0004 ADD R2 K37 R2
0x8C0C0324, // 0005 GETMET R3 R1 K36 0x8C0C0326, // 0005 GETMET R3 R1 K38
0x5C140400, // 0006 MOVE R5 R2 0x5C140400, // 0006 MOVE R5 R2
0x7C0C0400, // 0007 CALL R3 2 0x7C0C0400, // 0007 CALL R3 2
0x780E002A, // 0008 JMPF R3 #0034 0x780E002A, // 0008 JMPF R3 #0034
0x940C0202, // 0009 GETIDX R3 R1 R2 0x940C0202, // 0009 GETIDX R3 R1 R2
0x8C100701, // 000A GETMET R4 R3 K1 0x8C100702, // 000A GETMET R4 R3 K2
0x58180025, // 000B LDCONST R6 K37 0x58180027, // 000B LDCONST R6 K39
0x7C100400, // 000C CALL R4 2 0x7C100400, // 000C CALL R4 2
0x4C140000, // 000D LDNIL R5 0x4C140000, // 000D LDNIL R5
0x20140805, // 000E NE R5 R4 R5 0x20140805, // 000E NE R5 R4 R5
0x78160007, // 000F JMPF R5 #0018 0x78160007, // 000F JMPF R5 #0018
0x8814011F, // 0010 GETMBR R5 R0 K31 0x88140120, // 0010 GETMBR R5 R0 K32
0x20140805, // 0011 NE R5 R4 R5 0x20140805, // 0011 NE R5 R4 R5
0x78160003, // 0012 JMPF R5 #0017 0x78160003, // 0012 JMPF R5 #0017
0x8C140126, // 0013 GETMET R5 R0 K38 0x8C140128, // 0013 GETMET R5 R0 K40
0x541E0101, // 0014 LDINT R7 258 0x541E0101, // 0014 LDINT R7 258
0x5422000D, // 0015 LDINT R8 14 0x5422000D, // 0015 LDINT R8 14
0x7C140600, // 0016 CALL R5 3 0x7C140600, // 0016 CALL R5 3
0x90023E04, // 0017 SETMBR R0 K31 R4 0x90024004, // 0017 SETMBR R0 K32 R4
0x8C140701, // 0018 GETMET R5 R3 K1 0x8C140702, // 0018 GETMET R5 R3 K2
0x581C0027, // 0019 LDCONST R7 K39 0x581C0029, // 0019 LDCONST R7 K41
0x7C140400, // 001A CALL R5 2 0x7C140400, // 001A CALL R5 2
0x4C180000, // 001B LDNIL R6 0x4C180000, // 001B LDNIL R6
0x20180A06, // 001C NE R6 R5 R6 0x20180A06, // 001C NE R6 R5 R6
0x781A0007, // 001D JMPF R6 #0026 0x781A0007, // 001D JMPF R6 #0026
0x88180120, // 001E GETMBR R6 R0 K32 0x88180122, // 001E GETMBR R6 R0 K34
0x20180A06, // 001F NE R6 R5 R6 0x20180A06, // 001F NE R6 R5 R6
0x781A0003, // 0020 JMPF R6 #0025 0x781A0003, // 0020 JMPF R6 #0025
0x8C180126, // 0021 GETMET R6 R0 K38 0x8C180128, // 0021 GETMET R6 R0 K40
0x54220101, // 0022 LDINT R8 258 0x54220101, // 0022 LDINT R8 258
0x54260009, // 0023 LDINT R9 10 0x54260009, // 0023 LDINT R9 10
0x7C180600, // 0024 CALL R6 3 0x7C180600, // 0024 CALL R6 3
0x90024005, // 0025 SETMBR R0 K32 R5 0x90024405, // 0025 SETMBR R0 K34 R5
0x8C180701, // 0026 GETMET R6 R3 K1 0x8C180702, // 0026 GETMET R6 R3 K2
0x58200028, // 0027 LDCONST R8 K40 0x5820002A, // 0027 LDCONST R8 K42
0x7C180400, // 0028 CALL R6 2 0x7C180400, // 0028 CALL R6 2
0x4C1C0000, // 0029 LDNIL R7 0x4C1C0000, // 0029 LDNIL R7
0x201C0C07, // 002A NE R7 R6 R7 0x201C0C07, // 002A NE R7 R6 R7
0x781E0007, // 002B JMPF R7 #0034 0x781E0007, // 002B JMPF R7 #0034
0x881C0121, // 002C GETMBR R7 R0 K33 0x881C0123, // 002C GETMBR R7 R0 K35
0x201C0C07, // 002D NE R7 R6 R7 0x201C0C07, // 002D NE R7 R6 R7
0x781E0003, // 002E JMPF R7 #0033 0x781E0003, // 002E JMPF R7 #0033
0x8C1C0126, // 002F GETMET R7 R0 K38 0x8C1C0128, // 002F GETMET R7 R0 K40
0x54260101, // 0030 LDINT R9 258 0x54260101, // 0030 LDINT R9 258
0x542A000A, // 0031 LDINT R10 11 0x542A000A, // 0031 LDINT R10 11
0x7C1C0600, // 0032 CALL R7 3 0x7C1C0600, // 0032 CALL R7 3
0x90024206, // 0033 SETMBR R0 K33 R6 0x90024606, // 0033 SETMBR R0 K35 R6
0x80000000, // 0034 RET 0 0x80000000, // 0034 RET 0
}) })
) )
@ -504,30 +526,30 @@ be_local_closure(class_Matter_Plugin_Shutter_update_inverted, /* name */
be_str_weak(update_inverted), be_str_weak(update_inverted),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[37]) { /* code */ ( &(const binstruction[37]) { /* code */
0x88040104, // 0000 GETMBR R1 R0 K4 0x88040105, // 0000 GETMBR R1 R0 K5
0x5409FFFE, // 0001 LDINT R2 -1 0x5409FFFE, // 0001 LDINT R2 -1
0x1C040202, // 0002 EQ R1 R1 R2 0x1C040202, // 0002 EQ R1 R1 R2
0x7806001F, // 0003 JMPF R1 #0024 0x7806001F, // 0003 JMPF R1 #0024
0xB8061600, // 0004 GETNGBL R1 K11 0xB8061800, // 0004 GETNGBL R1 K12
0x8C04030C, // 0005 GETMET R1 R1 K12 0x8C04030D, // 0005 GETMET R1 R1 K13
0x580C0029, // 0006 LDCONST R3 K41 0x580C002B, // 0006 LDCONST R3 K43
0x50100200, // 0007 LDBOOL R4 1 0 0x50100200, // 0007 LDBOOL R4 1 0
0x7C040600, // 0008 CALL R1 3 0x7C040600, // 0008 CALL R1 3
0x8C080324, // 0009 GETMET R2 R1 K36 0x8C080326, // 0009 GETMET R2 R1 K38
0x5810002A, // 000A LDCONST R4 K42 0x5810002C, // 000A LDCONST R4 K44
0x7C080400, // 000B CALL R2 2 0x7C080400, // 000B CALL R2 2
0x780A0016, // 000C JMPF R2 #0024 0x780A0016, // 000C JMPF R2 #0024
0x9404032A, // 000D GETIDX R1 R1 K42 0x9404032C, // 000D GETIDX R1 R1 K44
0x8C080301, // 000E GETMET R2 R1 K1 0x8C080302, // 000E GETMET R2 R1 K2
0x60100008, // 000F GETGBL R4 G8 0x60100008, // 000F GETGBL R4 G8
0x88140100, // 0010 GETMBR R5 R0 K0 0x88140101, // 0010 GETMBR R5 R0 K1
0x7C100200, // 0011 CALL R4 1 0x7C100200, // 0011 CALL R4 1
0x00125604, // 0012 ADD R4 K43 R4 0x00125A04, // 0012 ADD R4 K45 R4
0x60140013, // 0013 GETGBL R5 G19 0x60140013, // 0013 GETGBL R5 G19
0x7C140000, // 0014 CALL R5 0 0x7C140000, // 0014 CALL R5 0
0x7C080600, // 0015 CALL R2 3 0x7C080600, // 0015 CALL R2 3
0x8C080501, // 0016 GETMET R2 R2 K1 0x8C080502, // 0016 GETMET R2 R2 K2
0x5810002C, // 0017 LDCONST R4 K44 0x5810002E, // 0017 LDCONST R4 K46
0x7C080400, // 0018 CALL R2 2 0x7C080400, // 0018 CALL R2 2
0x4C0C0000, // 0019 LDNIL R3 0x4C0C0000, // 0019 LDNIL R3
0x200C0403, // 001A NE R3 R2 R3 0x200C0403, // 001A NE R3 R2 R3
@ -536,10 +558,10 @@ be_local_closure(class_Matter_Plugin_Shutter_update_inverted, /* name */
0x6010000C, // 001D GETGBL R4 G12 0x6010000C, // 001D GETGBL R4 G12
0x5C140400, // 001E MOVE R5 R2 0x5C140400, // 001E MOVE R5 R2
0x7C100200, // 001F CALL R4 1 0x7C100200, // 001F CALL R4 1
0x0410090E, // 0020 SUB R4 R4 K14 0x0410090F, // 0020 SUB R4 R4 K15
0x94100404, // 0021 GETIDX R4 R2 R4 0x94100404, // 0021 GETIDX R4 R2 R4
0x7C0C0200, // 0022 CALL R3 1 0x7C0C0200, // 0022 CALL R3 1
0x90020803, // 0023 SETMBR R0 K4 R3 0x90020A03, // 0023 SETMBR R0 K5 R3
0x80000000, // 0024 RET 0 0x80000000, // 0024 RET 0
}) })
) )
@ -564,27 +586,27 @@ be_local_closure(class_Matter_Plugin_Shutter_update_shadow, /* name */
be_str_weak(update_shadow), be_str_weak(update_shadow),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[23]) { /* code */ ( &(const binstruction[23]) { /* code */
0x8804012D, // 0000 GETMBR R1 R0 K45 0x8804012F, // 0000 GETMBR R1 R0 K47
0x7406000E, // 0001 JMPT R1 #0011 0x7406000E, // 0001 JMPT R1 #0011
0x8C04011B, // 0002 GETMET R1 R0 K27 0x8C04011C, // 0002 GETMET R1 R0 K28
0x7C040200, // 0003 CALL R1 1 0x7C040200, // 0003 CALL R1 1
0xB8061600, // 0004 GETNGBL R1 K11 0xB8061800, // 0004 GETNGBL R1 K12
0x8C04030C, // 0005 GETMET R1 R1 K12 0x8C04030D, // 0005 GETMET R1 R1 K13
0x600C0008, // 0006 GETGBL R3 G8 0x600C0008, // 0006 GETGBL R3 G8
0x88100100, // 0007 GETMBR R4 R0 K0 0x88100101, // 0007 GETMBR R4 R0 K1
0x0010090E, // 0008 ADD R4 R4 K14 0x0010090F, // 0008 ADD R4 R4 K15
0x7C0C0200, // 0009 CALL R3 1 0x7C0C0200, // 0009 CALL R3 1
0x000E2C03, // 000A ADD R3 K22 R3 0x000E2E03, // 000A ADD R3 K23 R3
0x50100200, // 000B LDBOOL R4 1 0 0x50100200, // 000B LDBOOL R4 1 0
0x7C040600, // 000C CALL R1 3 0x7C040600, // 000C CALL R1 3
0x78060002, // 000D JMPF R1 #0011 0x78060002, // 000D JMPF R1 #0011
0x8C08012E, // 000E GETMET R2 R0 K46 0x8C080130, // 000E GETMET R2 R0 K48
0x5C100200, // 000F MOVE R4 R1 0x5C100200, // 000F MOVE R4 R1
0x7C080400, // 0010 CALL R2 2 0x7C080400, // 0010 CALL R2 2
0x60040003, // 0011 GETGBL R1 G3 0x60040003, // 0011 GETGBL R1 G3
0x5C080000, // 0012 MOVE R2 R0 0x5C080000, // 0012 MOVE R2 R0
0x7C040200, // 0013 CALL R1 1 0x7C040200, // 0013 CALL R1 1
0x8C04030F, // 0014 GETMET R1 R1 K15 0x8C040310, // 0014 GETMET R1 R1 K16
0x7C040200, // 0015 CALL R1 1 0x7C040200, // 0015 CALL R1 1
0x80000000, // 0016 RET 0 0x80000000, // 0016 RET 0
}) })

View File

@ -3,8 +3,8 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Light1' ktab size: 54, total: 108 (saved 432 bytes) // compact class 'Matter_Plugin_Light1' ktab size: 55, total: 109 (saved 432 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Light1[54] = { static const bvalue be_ktab_class_Matter_Plugin_Light1[55] = {
/* K0 */ be_const_int(0), /* K0 */ be_const_int(0),
/* K1 */ be_nested_str_weak(BRIDGE), /* K1 */ be_nested_str_weak(BRIDGE),
/* K2 */ be_nested_str_weak(tasmota), /* K2 */ be_nested_str_weak(tasmota),
@ -44,21 +44,22 @@ static const bvalue be_ktab_class_Matter_Plugin_Light1[54] = {
/* K36 */ be_nested_str_weak(attribute), /* K36 */ be_nested_str_weak(attribute),
/* K37 */ be_nested_str_weak(U1), /* K37 */ be_nested_str_weak(U1),
/* K38 */ be_nested_str_weak(read_attribute), /* K38 */ be_nested_str_weak(read_attribute),
/* K39 */ be_nested_str_weak(tasmota_relay_index), /* K39 */ be_nested_str_weak(parse_configuration),
/* K40 */ be_nested_str_weak(find), /* K40 */ be_nested_str_weak(tasmota_relay_index),
/* K41 */ be_nested_str_weak(ARG), /* K41 */ be_nested_str_weak(find),
/* K42 */ be_nested_str_weak(TYPE), /* K42 */ be_nested_str_weak(ARG),
/* K43 */ be_nested_str_weak(light1), /* K43 */ be_nested_str_weak(TYPE),
/* K44 */ be_nested_str_weak(get_option), /* K44 */ be_nested_str_weak(light1),
/* K45 */ be_nested_str_weak(get), /* K45 */ be_nested_str_weak(get_option),
/* K46 */ be_nested_str_weak(update_virtual), /* K46 */ be_nested_str_weak(get),
/* K47 */ be_nested_str_weak(init), /* K47 */ be_nested_str_weak(update_virtual),
/* K48 */ be_nested_str_weak(webserver), /* K48 */ be_nested_str_weak(init),
/* K49 */ be_nested_str_weak(web_values_prefix), /* K49 */ be_nested_str_weak(webserver),
/* K50 */ be_nested_str_weak(content_send), /* K50 */ be_nested_str_weak(web_values_prefix),
/* K51 */ be_nested_str_weak(_X25s_X20_X25s), /* K51 */ be_nested_str_weak(content_send),
/* K52 */ be_nested_str_weak(web_value_onoff), /* K52 */ be_nested_str_weak(_X25s_X20_X25s),
/* K53 */ be_nested_str_weak(web_value_dimmer), /* K53 */ be_nested_str_weak(web_value_onoff),
/* K54 */ be_nested_str_weak(web_value_dimmer),
}; };
@ -226,7 +227,7 @@ be_local_closure(class_Matter_Plugin_Light1_web_value_dimmer, /* name */
********************************************************************/ ********************************************************************/
be_local_closure(class_Matter_Plugin_Light1_invoke_request, /* name */ be_local_closure(class_Matter_Plugin_Light1_invoke_request, /* name */
be_nested_proto( be_nested_proto(
22, /* nstack */ 24, /* nstack */
4, /* argc */ 4, /* argc */
10, /* varg */ 10, /* varg */
0, /* has upvals */ 0, /* has upvals */
@ -309,22 +310,22 @@ be_local_closure(class_Matter_Plugin_Light1_invoke_request, /* name */
0x002A380A, // 0044 ADD R10 K28 R10 0x002A380A, // 0044 ADD R10 K28 R10
0x900E360A, // 0045 SETMBR R3 K27 R10 0x900E360A, // 0045 SETMBR R3 K27 R10
0x8C28011D, // 0046 GETMET R10 R0 K29 0x8C28011D, // 0046 GETMET R10 R0 K29
0x5830001E, // 0047 LDCONST R12 K30 0x58300022, // 0047 LDCONST R12 K34
0x5C341000, // 0048 MOVE R13 R8 0x78260001, // 0048 JMPF R9 #004B
0x58380005, // 0049 LDCONST R14 K5 0x5834001F, // 0049 LDCONST R13 K31
0xB83E0400, // 004A GETNGBL R15 K2 0x70020000, // 004A JMP #004C
0x8C3C1F03, // 004B GETMET R15 R15 K3 0x58340000, // 004B LDCONST R13 K0
0x5C441000, // 004C MOVE R17 R8 0x5838001E, // 004C LDCONST R14 K30
0x58480000, // 004D LDCONST R18 K0 0x5C3C1000, // 004D MOVE R15 R8
0x544E00FD, // 004E LDINT R19 254 0x58400005, // 004E LDCONST R16 K5
0x58500000, // 004F LDCONST R20 K0 0xB8460400, // 004F GETNGBL R17 K2
0x54560063, // 0050 LDINT R21 100 0x8C442303, // 0050 GETMET R17 R17 K3
0x7C3C0C00, // 0051 CALL R15 6 0x5C4C1000, // 0051 MOVE R19 R8
0x58400022, // 0052 LDCONST R16 K34 0x58500000, // 0052 LDCONST R20 K0
0x78260001, // 0053 JMPF R9 #0056 0x545600FD, // 0053 LDINT R21 254
0x5844001F, // 0054 LDCONST R17 K31 0x58580000, // 0054 LDCONST R22 K0
0x70020000, // 0055 JMP #0057 0x545E0063, // 0055 LDINT R23 100
0x58440000, // 0056 LDCONST R17 K0 0x7C440C00, // 0056 CALL R17 6
0x7C280E00, // 0057 CALL R10 7 0x7C280E00, // 0057 CALL R10 7
0x50280200, // 0058 LDBOOL R10 1 0 0x50280200, // 0058 LDBOOL R10 1 0
0x80041400, // 0059 RET 1 R10 0x80041400, // 0059 RET 1 R10
@ -461,59 +462,65 @@ be_local_closure(class_Matter_Plugin_Light1_parse_configuration, /* name */
&be_ktab_class_Matter_Plugin_Light1, /* shared constants */ &be_ktab_class_Matter_Plugin_Light1, /* shared constants */
be_str_weak(parse_configuration), be_str_weak(parse_configuration),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[52]) { /* code */ ( &(const binstruction[58]) { /* code */
0x88080101, // 0000 GETMBR R2 R0 K1 0x60080003, // 0000 GETGBL R2 G3
0x780A000F, // 0001 JMPF R2 #0012 0x5C0C0000, // 0001 MOVE R3 R0
0x60080009, // 0002 GETGBL R2 G9 0x7C080200, // 0002 CALL R2 1
0x8C0C0328, // 0003 GETMET R3 R1 K40 0x8C080527, // 0003 GETMET R2 R2 K39
0x88140129, // 0004 GETMBR R5 R0 K41 0x5C100200, // 0004 MOVE R4 R1
0x4C180000, // 0005 LDNIL R6 0x7C080400, // 0005 CALL R2 2
0x7C0C0600, // 0006 CALL R3 3 0x88080101, // 0006 GETMBR R2 R0 K1
0x7C080200, // 0007 CALL R2 1 0x780A000F, // 0007 JMPF R2 #0018
0x90024E02, // 0008 SETMBR R0 K39 R2 0x60080009, // 0008 GETGBL R2 G9
0x88080127, // 0009 GETMBR R2 R0 K39 0x8C0C0329, // 0009 GETMET R3 R1 K41
0x4C0C0000, // 000A LDNIL R3 0x8814012A, // 000A GETMBR R5 R0 K42
0x20080403, // 000B NE R2 R2 R3 0x4C180000, // 000B LDNIL R6
0x780A0003, // 000C JMPF R2 #0011 0x7C0C0600, // 000C CALL R3 3
0x88080127, // 000D GETMBR R2 R0 K39 0x7C080200, // 000D CALL R2 1
0x18080500, // 000E LE R2 R2 K0 0x90025002, // 000E SETMBR R0 K40 R2
0x780A0000, // 000F JMPF R2 #0011 0x88080128, // 000F GETMBR R2 R0 K40
0x90024F1F, // 0010 SETMBR R0 K39 K31 0x4C0C0000, // 0010 LDNIL R3
0x70020020, // 0011 JMP #0033 0x20080403, // 0011 NE R2 R2 R3
0x88080127, // 0012 GETMBR R2 R0 K39 0x780A0003, // 0012 JMPF R2 #0017
0x4C0C0000, // 0013 LDNIL R3 0x88080128, // 0013 GETMBR R2 R0 K40
0x1C080403, // 0014 EQ R2 R2 R3 0x18080500, // 0014 LE R2 R2 K0
0x780A001C, // 0015 JMPF R2 #0033 0x780A0000, // 0015 JMPF R2 #0017
0x8808012A, // 0016 GETMBR R2 R0 K42 0x9002511F, // 0016 SETMBR R0 K40 K31
0x1C08052B, // 0017 EQ R2 R2 K43 0x70020020, // 0017 JMP #0039
0x780A0019, // 0018 JMPF R2 #0033 0x88080128, // 0018 GETMBR R2 R0 K40
0x8C080328, // 0019 GETMET R2 R1 K40 0x4C0C0000, // 0019 LDNIL R3
0x88100129, // 001A GETMBR R4 R0 K41 0x1C080403, // 001A EQ R2 R2 R3
0x7C080400, // 001B CALL R2 2 0x780A001C, // 001B JMPF R2 #0039
0x4C0C0000, // 001C LDNIL R3 0x8808012B, // 001C GETMBR R2 R0 K43
0x1C0C0403, // 001D EQ R3 R2 R3 0x1C08052C, // 001D EQ R2 R2 K44
0x780E000E, // 001E JMPF R3 #002E 0x780A0019, // 001E JMPF R2 #0039
0xB80E0400, // 001F GETNGBL R3 K2 0x8C080329, // 001F GETMET R2 R1 K41
0x8C0C072C, // 0020 GETMET R3 R3 K44 0x8810012A, // 0020 GETMBR R4 R0 K42
0x54160043, // 0021 LDINT R5 68 0x7C080400, // 0021 CALL R2 2
0x7C0C0400, // 0022 CALL R3 2 0x4C0C0000, // 0022 LDNIL R3
0x1C0C0700, // 0023 EQ R3 R3 K0 0x1C0C0403, // 0023 EQ R3 R2 R3
0x780E0007, // 0024 JMPF R3 #002D 0x780E000E, // 0024 JMPF R3 #0034
0xA40E1600, // 0025 IMPORT R3 K11 0xB80E0400, // 0025 GETNGBL R3 K2
0x8C10072D, // 0026 GETMET R4 R3 K45 0x8C0C072D, // 0026 GETMET R3 R3 K45
0x5818001F, // 0027 LDCONST R6 K31 0x54160043, // 0027 LDINT R5 68
0x7C100400, // 0028 CALL R4 2 0x7C0C0400, // 0028 CALL R3 2
0x4C140000, // 0029 LDNIL R5 0x1C0C0700, // 0029 EQ R3 R3 K0
0x20100805, // 002A NE R4 R4 R5 0x780E0007, // 002A JMPF R3 #0033
0x78120000, // 002B JMPF R4 #002D 0xA40E1600, // 002B IMPORT R3 K11
0x90021D1F, // 002C SETMBR R0 K14 K31 0x8C10072E, // 002C GETMET R4 R3 K46
0x70020004, // 002D JMP #0033 0x5818001F, // 002D LDCONST R6 K31
0x600C0009, // 002E GETGBL R3 G9 0x7C100400, // 002E CALL R4 2
0x5C100400, // 002F MOVE R4 R2 0x4C140000, // 002F LDNIL R5
0x7C0C0200, // 0030 CALL R3 1 0x20100805, // 0030 NE R4 R4 R5
0x040C071F, // 0031 SUB R3 R3 K31 0x78120000, // 0031 JMPF R4 #0033
0x90021C03, // 0032 SETMBR R0 K14 R3 0x90021D1F, // 0032 SETMBR R0 K14 K31
0x80000000, // 0033 RET 0 0x70020004, // 0033 JMP #0039
0x600C0009, // 0034 GETGBL R3 G9
0x5C100400, // 0035 MOVE R4 R2
0x7C0C0200, // 0036 CALL R3 1
0x040C071F, // 0037 SUB R3 R3 K31
0x90021C03, // 0038 SETMBR R0 K14 R3
0x80000000, // 0039 RET 0
}) })
) )
); );
@ -537,10 +544,10 @@ be_local_closure(class_Matter_Plugin_Light1_update_virtual, /* name */
be_str_weak(update_virtual), be_str_weak(update_virtual),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[23]) { /* code */ ( &(const binstruction[23]) { /* code */
0x8C080328, // 0000 GETMET R2 R1 K40 0x8C080329, // 0000 GETMET R2 R1 K41
0x58100022, // 0001 LDCONST R4 K34 0x58100022, // 0001 LDCONST R4 K34
0x7C080400, // 0002 CALL R2 2 0x7C080400, // 0002 CALL R2 2
0x8C0C0328, // 0003 GETMET R3 R1 K40 0x8C0C0329, // 0003 GETMET R3 R1 K41
0x5814001E, // 0004 LDCONST R5 K30 0x5814001E, // 0004 LDCONST R5 K30
0x7C0C0400, // 0005 CALL R3 2 0x7C0C0400, // 0005 CALL R3 2
0x4C100000, // 0006 LDNIL R4 0x4C100000, // 0006 LDNIL R4
@ -556,7 +563,7 @@ be_local_closure(class_Matter_Plugin_Light1_update_virtual, /* name */
0x60100003, // 0010 GETGBL R4 G3 0x60100003, // 0010 GETGBL R4 G3
0x5C140000, // 0011 MOVE R5 R0 0x5C140000, // 0011 MOVE R5 R0
0x7C100200, // 0012 CALL R4 1 0x7C100200, // 0012 CALL R4 1
0x8C10092E, // 0013 GETMET R4 R4 K46 0x8C10092F, // 0013 GETMET R4 R4 K47
0x5C180200, // 0014 MOVE R6 R1 0x5C180200, // 0014 MOVE R6 R1
0x7C100400, // 0015 CALL R4 2 0x7C100400, // 0015 CALL R4 2
0x80000000, // 0016 RET 0 0x80000000, // 0016 RET 0
@ -587,7 +594,7 @@ be_local_closure(class_Matter_Plugin_Light1_init, /* name */
0x60100003, // 0001 GETGBL R4 G3 0x60100003, // 0001 GETGBL R4 G3
0x5C140000, // 0002 MOVE R5 R0 0x5C140000, // 0002 MOVE R5 R0
0x7C100200, // 0003 CALL R4 1 0x7C100200, // 0003 CALL R4 1
0x8C10092F, // 0004 GETMET R4 R4 K47 0x8C100930, // 0004 GETMET R4 R4 K48
0x5C180200, // 0005 MOVE R6 R1 0x5C180200, // 0005 MOVE R6 R1
0x5C1C0400, // 0006 MOVE R7 R2 0x5C1C0400, // 0006 MOVE R7 R2
0x5C200600, // 0007 MOVE R8 R3 0x5C200600, // 0007 MOVE R8 R3
@ -616,16 +623,16 @@ be_local_closure(class_Matter_Plugin_Light1_web_values, /* name */
be_str_weak(web_values), be_str_weak(web_values),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[14]) { /* code */ ( &(const binstruction[14]) { /* code */
0xA4066000, // 0000 IMPORT R1 K48 0xA4066200, // 0000 IMPORT R1 K49
0x8C080131, // 0001 GETMET R2 R0 K49 0x8C080132, // 0001 GETMET R2 R0 K50
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
0x8C080332, // 0003 GETMET R2 R1 K50 0x8C080333, // 0003 GETMET R2 R1 K51
0x60100018, // 0004 GETGBL R4 G24 0x60100018, // 0004 GETGBL R4 G24
0x58140033, // 0005 LDCONST R5 K51 0x58140034, // 0005 LDCONST R5 K52
0x8C180134, // 0006 GETMET R6 R0 K52 0x8C180135, // 0006 GETMET R6 R0 K53
0x88200108, // 0007 GETMBR R8 R0 K8 0x88200108, // 0007 GETMBR R8 R0 K8
0x7C180400, // 0008 CALL R6 2 0x7C180400, // 0008 CALL R6 2
0x8C1C0135, // 0009 GETMET R7 R0 K53 0x8C1C0136, // 0009 GETMET R7 R0 K54
0x7C1C0200, // 000A CALL R7 1 0x7C1C0200, // 000A CALL R7 1
0x7C100600, // 000B CALL R4 3 0x7C100600, // 000B CALL R4 3
0x7C080400, // 000C CALL R2 2 0x7C080400, // 000C CALL R2 2
@ -664,7 +671,7 @@ be_local_closure(class_Matter_Plugin_Light1_parse_status, /* name */
0x1C0C0403, // 0008 EQ R3 R2 R3 0x1C0C0403, // 0008 EQ R3 R2 R3
0x780E0017, // 0009 JMPF R3 #0022 0x780E0017, // 0009 JMPF R3 #0022
0x600C0009, // 000A GETGBL R3 G9 0x600C0009, // 000A GETGBL R3 G9
0x8C100328, // 000B GETMET R4 R1 K40 0x8C100329, // 000B GETMET R4 R1 K41
0x58180005, // 000C LDCONST R6 K5 0x58180005, // 000C LDCONST R6 K5
0x7C100400, // 000D CALL R4 2 0x7C100400, // 000D CALL R4 2
0x7C0C0200, // 000E CALL R3 1 0x7C0C0200, // 000E CALL R3 1
@ -716,13 +723,13 @@ be_local_closure(class_Matter_Plugin_Light1_update_shadow, /* name */
0x88040101, // 0002 GETMBR R1 R0 K1 0x88040101, // 0002 GETMBR R1 R0 K1
0x7406002A, // 0003 JMPT R1 #002F 0x7406002A, // 0003 JMPT R1 #002F
0xA4061600, // 0004 IMPORT R1 K11 0xA4061600, // 0004 IMPORT R1 K11
0x8C08032D, // 0005 GETMET R2 R1 K45 0x8C08032E, // 0005 GETMET R2 R1 K46
0x8810010E, // 0006 GETMBR R4 R0 K14 0x8810010E, // 0006 GETMBR R4 R0 K14
0x7C080400, // 0007 CALL R2 2 0x7C080400, // 0007 CALL R2 2
0x4C0C0000, // 0008 LDNIL R3 0x4C0C0000, // 0008 LDNIL R3
0x200C0403, // 0009 NE R3 R2 R3 0x200C0403, // 0009 NE R3 R2 R3
0x780E0023, // 000A JMPF R3 #002F 0x780E0023, // 000A JMPF R3 #002F
0x8C0C0528, // 000B GETMET R3 R2 K40 0x8C0C0529, // 000B GETMET R3 R2 K41
0x5814000F, // 000C LDCONST R5 K15 0x5814000F, // 000C LDCONST R5 K15
0x4C180000, // 000D LDNIL R6 0x4C180000, // 000D LDNIL R6
0x7C0C0600, // 000E CALL R3 3 0x7C0C0600, // 000E CALL R3 3
@ -734,7 +741,7 @@ be_local_closure(class_Matter_Plugin_Light1_update_shadow, /* name */
0x581C0000, // 0014 LDCONST R7 K0 0x581C0000, // 0014 LDCONST R7 K0
0x7C100600, // 0015 CALL R4 3 0x7C100600, // 0015 CALL R4 3
0x90021003, // 0016 SETMBR R0 K8 R3 0x90021003, // 0016 SETMBR R0 K8 R3
0x8C100528, // 0017 GETMET R4 R2 K40 0x8C100529, // 0017 GETMET R4 R2 K41
0x5818000D, // 0018 LDCONST R6 K13 0x5818000D, // 0018 LDCONST R6 K13
0x4C1C0000, // 0019 LDNIL R7 0x4C1C0000, // 0019 LDNIL R7
0x7C100600, // 001A CALL R4 3 0x7C100600, // 001A CALL R4 3

View File

@ -3,76 +3,34 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_Contact' ktab size: 24, total: 31 (saved 56 bytes) // compact class 'Matter_Plugin_Sensor_Contact' ktab size: 21, total: 26 (saved 40 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_Contact[24] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_Contact[21] = {
/* K0 */ be_nested_str_weak(shadow_bool_value), /* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(_parse_update_virtual), /* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(Contact), /* K2 */ be_nested_str_weak(cluster),
/* K3 */ be_const_int(0), /* K3 */ be_nested_str_weak(attribute),
/* K4 */ be_nested_str_weak(update_virtual), /* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(matter), /* K5 */ be_nested_str_weak(set_or_nil),
/* K6 */ be_nested_str_weak(TLV), /* K6 */ be_nested_str_weak(BOOL),
/* K7 */ be_nested_str_weak(cluster), /* K7 */ be_nested_str_weak(shadow_bool_value),
/* K8 */ be_nested_str_weak(attribute), /* K8 */ be_nested_str_weak(read_attribute),
/* K9 */ be_nested_str_weak(set_or_nil), /* K9 */ be_nested_str_weak(webserver),
/* K10 */ be_nested_str_weak(BOOL), /* K10 */ be_nested_str_weak(web_values_prefix),
/* K11 */ be_nested_str_weak(read_attribute), /* K11 */ be_nested_str_weak(content_send),
/* K12 */ be_nested_str_weak(webserver), /* K12 */ be_nested_str_weak(Contact_X25i_X20_X25s),
/* K13 */ be_nested_str_weak(web_values_prefix), /* K13 */ be_nested_str_weak(tasmota_switch_index),
/* K14 */ be_nested_str_weak(content_send), /* K14 */ be_nested_str_weak(web_value_onoff),
/* K15 */ be_nested_str_weak(Contact_X25i_X20_X25s), /* K15 */ be_nested_str_weak(get_name),
/* K16 */ be_nested_str_weak(tasmota_switch_index), /* K16 */ be_nested_str_weak(Switch),
/* K17 */ be_nested_str_weak(web_value_onoff), /* K17 */ be_nested_str_weak(PREFIX),
/* K18 */ be_nested_str_weak(get_name), /* K18 */ be_nested_str_weak(html_escape),
/* K19 */ be_nested_str_weak(Switch), /* K19 */ be_nested_str_weak(),
/* K20 */ be_nested_str_weak(PREFIX), /* K20 */ be_nested_str_weak(attribute_updated),
/* K21 */ be_nested_str_weak(html_escape),
/* K22 */ be_nested_str_weak(),
/* K23 */ be_nested_str_weak(attribute_updated),
}; };
extern const bclass be_class_Matter_Plugin_Sensor_Contact; extern const bclass be_class_Matter_Plugin_Sensor_Contact;
/********************************************************************
** Solidified function: update_virtual
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Contact_update_virtual, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Contact, /* shared constants */
be_str_weak(update_virtual),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x8C080101, // 0000 GETMET R2 R0 K1
0x5C100200, // 0001 MOVE R4 R1
0x58140002, // 0002 LDCONST R5 K2
0x88180100, // 0003 GETMBR R6 R0 K0
0x601C0017, // 0004 GETGBL R7 G23
0x54220044, // 0005 LDINT R8 69
0x58240003, // 0006 LDCONST R9 K3
0x7C080E00, // 0007 CALL R2 7
0x90020002, // 0008 SETMBR R0 K0 R2
0x60080003, // 0009 GETGBL R2 G3
0x5C0C0000, // 000A MOVE R3 R0
0x7C080200, // 000B CALL R2 1
0x8C080504, // 000C GETMET R2 R2 K4
0x5C100200, // 000D MOVE R4 R1
0x7C080400, // 000E CALL R2 2
0x80000000, // 000F RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: read_attribute ** Solidified function: read_attribute
********************************************************************/ ********************************************************************/
@ -90,24 +48,24 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_read_attribute, /* name */
be_str_weak(read_attribute), be_str_weak(read_attribute),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[23]) { /* code */ ( &(const binstruction[23]) { /* code */
0xB8120A00, // 0000 GETNGBL R4 K5 0xB8120000, // 0000 GETNGBL R4 K0
0x88100906, // 0001 GETMBR R4 R4 K6 0x88100901, // 0001 GETMBR R4 R4 K1
0x88140507, // 0002 GETMBR R5 R2 K7 0x88140502, // 0002 GETMBR R5 R2 K2
0x88180508, // 0003 GETMBR R6 R2 K8 0x88180503, // 0003 GETMBR R6 R2 K3
0x541E0044, // 0004 LDINT R7 69 0x541E0044, // 0004 LDINT R7 69
0x1C1C0A07, // 0005 EQ R7 R5 R7 0x1C1C0A07, // 0005 EQ R7 R5 R7
0x781E0006, // 0006 JMPF R7 #000E 0x781E0006, // 0006 JMPF R7 #000E
0x1C1C0D03, // 0007 EQ R7 R6 K3 0x1C1C0D04, // 0007 EQ R7 R6 K4
0x781E0004, // 0008 JMPF R7 #000E 0x781E0004, // 0008 JMPF R7 #000E
0x8C1C0709, // 0009 GETMET R7 R3 K9 0x8C1C0705, // 0009 GETMET R7 R3 K5
0x8824090A, // 000A GETMBR R9 R4 K10 0x88240906, // 000A GETMBR R9 R4 K6
0x88280100, // 000B GETMBR R10 R0 K0 0x88280107, // 000B GETMBR R10 R0 K7
0x7C1C0600, // 000C CALL R7 3 0x7C1C0600, // 000C CALL R7 3
0x80040E00, // 000D RET 1 R7 0x80040E00, // 000D RET 1 R7
0x601C0003, // 000E GETGBL R7 G3 0x601C0003, // 000E GETGBL R7 G3
0x5C200000, // 000F MOVE R8 R0 0x5C200000, // 000F MOVE R8 R0
0x7C1C0200, // 0010 CALL R7 1 0x7C1C0200, // 0010 CALL R7 1
0x8C1C0F0B, // 0011 GETMET R7 R7 K11 0x8C1C0F08, // 0011 GETMET R7 R7 K8
0x5C240200, // 0012 MOVE R9 R1 0x5C240200, // 0012 MOVE R9 R1
0x5C280400, // 0013 MOVE R10 R2 0x5C280400, // 0013 MOVE R10 R2
0x5C2C0600, // 0014 MOVE R11 R3 0x5C2C0600, // 0014 MOVE R11 R3
@ -136,15 +94,15 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_web_values, /* name */
be_str_weak(web_values), be_str_weak(web_values),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[13]) { /* code */ ( &(const binstruction[13]) { /* code */
0xA4061800, // 0000 IMPORT R1 K12 0xA4061200, // 0000 IMPORT R1 K9
0x8C08010D, // 0001 GETMET R2 R0 K13 0x8C08010A, // 0001 GETMET R2 R0 K10
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
0x8C08030E, // 0003 GETMET R2 R1 K14 0x8C08030B, // 0003 GETMET R2 R1 K11
0x60100018, // 0004 GETGBL R4 G24 0x60100018, // 0004 GETGBL R4 G24
0x5814000F, // 0005 LDCONST R5 K15 0x5814000C, // 0005 LDCONST R5 K12
0x88180110, // 0006 GETMBR R6 R0 K16 0x8818010D, // 0006 GETMBR R6 R0 K13
0x8C1C0111, // 0007 GETMET R7 R0 K17 0x8C1C010E, // 0007 GETMET R7 R0 K14
0x88240100, // 0008 GETMBR R9 R0 K0 0x88240107, // 0008 GETMBR R9 R0 K7
0x7C1C0400, // 0009 CALL R7 2 0x7C1C0400, // 0009 CALL R7 2
0x7C100600, // 000A CALL R4 3 0x7C100600, // 000A CALL R4 3
0x7C080400, // 000B CALL R2 2 0x7C080400, // 000B CALL R2 2
@ -172,25 +130,25 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_web_values_prefix, /* name
be_str_weak(web_values_prefix), be_str_weak(web_values_prefix),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[22]) { /* code */ ( &(const binstruction[22]) { /* code */
0xA4061800, // 0000 IMPORT R1 K12 0xA4061200, // 0000 IMPORT R1 K9
0x8C080112, // 0001 GETMET R2 R0 K18 0x8C08010F, // 0001 GETMET R2 R0 K15
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
0x5C0C0400, // 0003 MOVE R3 R2 0x5C0C0400, // 0003 MOVE R3 R2
0x740E0004, // 0004 JMPT R3 #000A 0x740E0004, // 0004 JMPT R3 #000A
0x600C0008, // 0005 GETGBL R3 G8 0x600C0008, // 0005 GETGBL R3 G8
0x88100110, // 0006 GETMBR R4 R0 K16 0x8810010D, // 0006 GETMBR R4 R0 K13
0x7C0C0200, // 0007 CALL R3 1 0x7C0C0200, // 0007 CALL R3 1
0x000E2603, // 0008 ADD R3 K19 R3 0x000E2003, // 0008 ADD R3 K16 R3
0x5C080600, // 0009 MOVE R2 R3 0x5C080600, // 0009 MOVE R2 R3
0x8C0C030E, // 000A GETMET R3 R1 K14 0x8C0C030B, // 000A GETMET R3 R1 K11
0x60140018, // 000B GETGBL R5 G24 0x60140018, // 000B GETGBL R5 G24
0x88180114, // 000C GETMBR R6 R0 K20 0x88180111, // 000C GETMBR R6 R0 K17
0x780A0003, // 000D JMPF R2 #0012 0x780A0003, // 000D JMPF R2 #0012
0x8C1C0315, // 000E GETMET R7 R1 K21 0x8C1C0312, // 000E GETMET R7 R1 K18
0x5C240400, // 000F MOVE R9 R2 0x5C240400, // 000F MOVE R9 R2
0x7C1C0400, // 0010 CALL R7 2 0x7C1C0400, // 0010 CALL R7 2
0x70020000, // 0011 JMP #0013 0x70020000, // 0011 JMP #0013
0x581C0016, // 0012 LDCONST R7 K22 0x581C0013, // 0012 LDCONST R7 K19
0x7C140400, // 0013 CALL R5 2 0x7C140400, // 0013 CALL R5 2
0x7C0C0400, // 0014 CALL R3 2 0x7C0C0400, // 0014 CALL R3 2
0x80000000, // 0015 RET 0 0x80000000, // 0015 RET 0
@ -217,9 +175,9 @@ be_local_closure(class_Matter_Plugin_Sensor_Contact_value_updated, /* name */
be_str_weak(value_updated), be_str_weak(value_updated),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */ ( &(const binstruction[ 5]) { /* code */
0x8C040117, // 0000 GETMET R1 R0 K23 0x8C040114, // 0000 GETMET R1 R0 K20
0x540E0044, // 0001 LDINT R3 69 0x540E0044, // 0001 LDINT R3 69
0x58100003, // 0002 LDCONST R4 K3 0x58100004, // 0002 LDCONST R4 K4
0x7C040600, // 0003 CALL R1 3 0x7C040600, // 0003 CALL R1 3
0x80000000, // 0004 RET 0 0x80000000, // 0004 RET 0
}) })
@ -237,9 +195,13 @@ be_local_class(Matter_Plugin_Sensor_Contact,
&be_class_Matter_Plugin_Sensor_Boolean, &be_class_Matter_Plugin_Sensor_Boolean,
be_nested_map(10, be_nested_map(10,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(update_virtual, 6), be_const_closure(class_Matter_Plugin_Sensor_Contact_update_virtual_closure) }, { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(21, -1), be_const_int(1) },
})) ) } )) },
{ be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Contact) }, { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Contact) },
{ be_const_key_weak(read_attribute, 5), be_const_closure(class_Matter_Plugin_Sensor_Contact_read_attribute_closure) }, { be_const_key_weak(read_attribute, 6), be_const_closure(class_Matter_Plugin_Sensor_Contact_read_attribute_closure) },
{ be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1, be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) { ( (struct bvalue*) &(const bvalue[]) {
@ -255,12 +217,8 @@ be_local_class(Matter_Plugin_Sensor_Contact,
{ be_const_key_int(4, -1), be_const_bytes_instance(0000FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(4, -1), be_const_bytes_instance(0000FFF8FFF9FFFAFFFBFFFCFFFD) },
{ be_const_key_int(29, 0), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(29, 0), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(JSON_NAME, -1), be_nested_str_weak(Contact) },
{ be_const_key_weak(web_values, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_web_values_closure) }, { be_const_key_weak(web_values, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_web_values_closure) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(21, -1), be_const_int(1) },
})) ) } )) },
{ be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_web_values_prefix_closure) }, { be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_web_values_prefix_closure) },
{ be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_value_updated_closure) }, { be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Contact_value_updated_closure) },
{ be_const_key_weak(TYPE, 3), be_nested_str_weak(contact) }, { be_const_key_weak(TYPE, 3), be_nested_str_weak(contact) },

View File

@ -3,80 +3,38 @@
* Generated code, don't edit * * Generated code, don't edit *
\********************************************************************/ \********************************************************************/
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_Occupancy' ktab size: 28, total: 35 (saved 56 bytes) // compact class 'Matter_Plugin_Sensor_Occupancy' ktab size: 25, total: 30 (saved 40 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_Occupancy[28] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_Occupancy[25] = {
/* K0 */ be_nested_str_weak(shadow_bool_value), /* K0 */ be_nested_str_weak(matter),
/* K1 */ be_nested_str_weak(_parse_update_virtual), /* K1 */ be_nested_str_weak(TLV),
/* K2 */ be_nested_str_weak(Occupancy), /* K2 */ be_nested_str_weak(cluster),
/* K3 */ be_const_int(0), /* K3 */ be_nested_str_weak(attribute),
/* K4 */ be_nested_str_weak(update_virtual), /* K4 */ be_const_int(0),
/* K5 */ be_nested_str_weak(matter), /* K5 */ be_nested_str_weak(set_or_nil),
/* K6 */ be_nested_str_weak(TLV), /* K6 */ be_nested_str_weak(U1),
/* K7 */ be_nested_str_weak(cluster), /* K7 */ be_nested_str_weak(shadow_bool_value),
/* K8 */ be_nested_str_weak(attribute), /* K8 */ be_const_int(1),
/* K9 */ be_nested_str_weak(set_or_nil), /* K9 */ be_nested_str_weak(set),
/* K10 */ be_nested_str_weak(U1), /* K10 */ be_const_int(3),
/* K11 */ be_const_int(1), /* K11 */ be_const_int(2),
/* K12 */ be_nested_str_weak(set), /* K12 */ be_nested_str_weak(read_attribute),
/* K13 */ be_const_int(3), /* K13 */ be_nested_str_weak(webserver),
/* K14 */ be_const_int(2), /* K14 */ be_nested_str_weak(web_values_prefix),
/* K15 */ be_nested_str_weak(read_attribute), /* K15 */ be_nested_str_weak(content_send),
/* K16 */ be_nested_str_weak(webserver), /* K16 */ be_nested_str_weak(Occupancy_X25i_X20_X25s),
/* K17 */ be_nested_str_weak(web_values_prefix), /* K17 */ be_nested_str_weak(web_value_onoff),
/* K18 */ be_nested_str_weak(content_send), /* K18 */ be_nested_str_weak(shadow_occupancy),
/* K19 */ be_nested_str_weak(Occupancy_X25i_X20_X25s), /* K19 */ be_nested_str_weak(get_name),
/* K20 */ be_nested_str_weak(web_value_onoff), /* K20 */ be_nested_str_weak(Switch),
/* K21 */ be_nested_str_weak(shadow_occupancy), /* K21 */ be_nested_str_weak(PREFIX),
/* K22 */ be_nested_str_weak(get_name), /* K22 */ be_nested_str_weak(html_escape),
/* K23 */ be_nested_str_weak(Switch), /* K23 */ be_nested_str_weak(),
/* K24 */ be_nested_str_weak(PREFIX), /* K24 */ be_nested_str_weak(attribute_updated),
/* K25 */ be_nested_str_weak(html_escape),
/* K26 */ be_nested_str_weak(),
/* K27 */ be_nested_str_weak(attribute_updated),
}; };
extern const bclass be_class_Matter_Plugin_Sensor_Occupancy; extern const bclass be_class_Matter_Plugin_Sensor_Occupancy;
/********************************************************************
** Solidified function: update_virtual
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_Occupancy_update_virtual, /* name */
be_nested_proto(
10, /* nstack */
2, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_Occupancy, /* shared constants */
be_str_weak(update_virtual),
&be_const_str_solidified,
( &(const binstruction[16]) { /* code */
0x8C080101, // 0000 GETMET R2 R0 K1
0x5C100200, // 0001 MOVE R4 R1
0x58140002, // 0002 LDCONST R5 K2
0x88180100, // 0003 GETMBR R6 R0 K0
0x601C0017, // 0004 GETGBL R7 G23
0x54220405, // 0005 LDINT R8 1030
0x58240003, // 0006 LDCONST R9 K3
0x7C080E00, // 0007 CALL R2 7
0x90020002, // 0008 SETMBR R0 K0 R2
0x60080003, // 0009 GETGBL R2 G3
0x5C0C0000, // 000A MOVE R3 R0
0x7C080200, // 000B CALL R2 1
0x8C080504, // 000C GETMET R2 R2 K4
0x5C100200, // 000D MOVE R4 R1
0x7C080400, // 000E CALL R2 2
0x80000000, // 000F RET 0
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: read_attribute ** Solidified function: read_attribute
********************************************************************/ ********************************************************************/
@ -94,40 +52,40 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy_read_attribute, /* name
be_str_weak(read_attribute), be_str_weak(read_attribute),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[39]) { /* code */ ( &(const binstruction[39]) { /* code */
0xB8120A00, // 0000 GETNGBL R4 K5 0xB8120000, // 0000 GETNGBL R4 K0
0x88100906, // 0001 GETMBR R4 R4 K6 0x88100901, // 0001 GETMBR R4 R4 K1
0x88140507, // 0002 GETMBR R5 R2 K7 0x88140502, // 0002 GETMBR R5 R2 K2
0x88180508, // 0003 GETMBR R6 R2 K8 0x88180503, // 0003 GETMBR R6 R2 K3
0x541E0405, // 0004 LDINT R7 1030 0x541E0405, // 0004 LDINT R7 1030
0x1C1C0A07, // 0005 EQ R7 R5 R7 0x1C1C0A07, // 0005 EQ R7 R5 R7
0x781E0016, // 0006 JMPF R7 #001E 0x781E0016, // 0006 JMPF R7 #001E
0x1C1C0D03, // 0007 EQ R7 R6 K3 0x1C1C0D04, // 0007 EQ R7 R6 K4
0x781E0005, // 0008 JMPF R7 #000F 0x781E0005, // 0008 JMPF R7 #000F
0x8C1C0709, // 0009 GETMET R7 R3 K9 0x8C1C0705, // 0009 GETMET R7 R3 K5
0x8824090A, // 000A GETMBR R9 R4 K10 0x88240906, // 000A GETMBR R9 R4 K6
0x88280100, // 000B GETMBR R10 R0 K0 0x88280107, // 000B GETMBR R10 R0 K7
0x7C1C0600, // 000C CALL R7 3 0x7C1C0600, // 000C CALL R7 3
0x80040E00, // 000D RET 1 R7 0x80040E00, // 000D RET 1 R7
0x7002000E, // 000E JMP #001E 0x7002000E, // 000E JMP #001E
0x1C1C0D0B, // 000F EQ R7 R6 K11 0x1C1C0D08, // 000F EQ R7 R6 K8
0x781E0005, // 0010 JMPF R7 #0017 0x781E0005, // 0010 JMPF R7 #0017
0x8C1C070C, // 0011 GETMET R7 R3 K12 0x8C1C0709, // 0011 GETMET R7 R3 K9
0x8824090A, // 0012 GETMBR R9 R4 K10 0x88240906, // 0012 GETMBR R9 R4 K6
0x5828000D, // 0013 LDCONST R10 K13 0x5828000A, // 0013 LDCONST R10 K10
0x7C1C0600, // 0014 CALL R7 3 0x7C1C0600, // 0014 CALL R7 3
0x80040E00, // 0015 RET 1 R7 0x80040E00, // 0015 RET 1 R7
0x70020006, // 0016 JMP #001E 0x70020006, // 0016 JMP #001E
0x1C1C0D0E, // 0017 EQ R7 R6 K14 0x1C1C0D0B, // 0017 EQ R7 R6 K11
0x781E0004, // 0018 JMPF R7 #001E 0x781E0004, // 0018 JMPF R7 #001E
0x8C1C070C, // 0019 GETMET R7 R3 K12 0x8C1C0709, // 0019 GETMET R7 R3 K9
0x8824090A, // 001A GETMBR R9 R4 K10 0x88240906, // 001A GETMBR R9 R4 K6
0x58280003, // 001B LDCONST R10 K3 0x58280004, // 001B LDCONST R10 K4
0x7C1C0600, // 001C CALL R7 3 0x7C1C0600, // 001C CALL R7 3
0x80040E00, // 001D RET 1 R7 0x80040E00, // 001D RET 1 R7
0x601C0003, // 001E GETGBL R7 G3 0x601C0003, // 001E GETGBL R7 G3
0x5C200000, // 001F MOVE R8 R0 0x5C200000, // 001F MOVE R8 R0
0x7C1C0200, // 0020 CALL R7 1 0x7C1C0200, // 0020 CALL R7 1
0x8C1C0F0F, // 0021 GETMET R7 R7 K15 0x8C1C0F0C, // 0021 GETMET R7 R7 K12
0x5C240200, // 0022 MOVE R9 R1 0x5C240200, // 0022 MOVE R9 R1
0x5C280400, // 0023 MOVE R10 R2 0x5C280400, // 0023 MOVE R10 R2
0x5C2C0600, // 0024 MOVE R11 R3 0x5C2C0600, // 0024 MOVE R11 R3
@ -156,15 +114,15 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy_web_values, /* name */
be_str_weak(web_values), be_str_weak(web_values),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[13]) { /* code */ ( &(const binstruction[13]) { /* code */
0xA4062000, // 0000 IMPORT R1 K16 0xA4061A00, // 0000 IMPORT R1 K13
0x8C080111, // 0001 GETMET R2 R0 K17 0x8C08010E, // 0001 GETMET R2 R0 K14
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
0x8C080312, // 0003 GETMET R2 R1 K18 0x8C08030F, // 0003 GETMET R2 R1 K15
0x60100018, // 0004 GETGBL R4 G24 0x60100018, // 0004 GETGBL R4 G24
0x58140013, // 0005 LDCONST R5 K19 0x58140010, // 0005 LDCONST R5 K16
0x88180100, // 0006 GETMBR R6 R0 K0 0x88180107, // 0006 GETMBR R6 R0 K7
0x8C1C0114, // 0007 GETMET R7 R0 K20 0x8C1C0111, // 0007 GETMET R7 R0 K17
0x88240115, // 0008 GETMBR R9 R0 K21 0x88240112, // 0008 GETMBR R9 R0 K18
0x7C1C0400, // 0009 CALL R7 2 0x7C1C0400, // 0009 CALL R7 2
0x7C100600, // 000A CALL R4 3 0x7C100600, // 000A CALL R4 3
0x7C080400, // 000B CALL R2 2 0x7C080400, // 000B CALL R2 2
@ -192,25 +150,25 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy_web_values_prefix, /* na
be_str_weak(web_values_prefix), be_str_weak(web_values_prefix),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[22]) { /* code */ ( &(const binstruction[22]) { /* code */
0xA4062000, // 0000 IMPORT R1 K16 0xA4061A00, // 0000 IMPORT R1 K13
0x8C080116, // 0001 GETMET R2 R0 K22 0x8C080113, // 0001 GETMET R2 R0 K19
0x7C080200, // 0002 CALL R2 1 0x7C080200, // 0002 CALL R2 1
0x5C0C0400, // 0003 MOVE R3 R2 0x5C0C0400, // 0003 MOVE R3 R2
0x740E0004, // 0004 JMPT R3 #000A 0x740E0004, // 0004 JMPT R3 #000A
0x600C0008, // 0005 GETGBL R3 G8 0x600C0008, // 0005 GETGBL R3 G8
0x88100100, // 0006 GETMBR R4 R0 K0 0x88100107, // 0006 GETMBR R4 R0 K7
0x7C0C0200, // 0007 CALL R3 1 0x7C0C0200, // 0007 CALL R3 1
0x000E2E03, // 0008 ADD R3 K23 R3 0x000E2803, // 0008 ADD R3 K20 R3
0x5C080600, // 0009 MOVE R2 R3 0x5C080600, // 0009 MOVE R2 R3
0x8C0C0312, // 000A GETMET R3 R1 K18 0x8C0C030F, // 000A GETMET R3 R1 K15
0x60140018, // 000B GETGBL R5 G24 0x60140018, // 000B GETGBL R5 G24
0x88180118, // 000C GETMBR R6 R0 K24 0x88180115, // 000C GETMBR R6 R0 K21
0x780A0003, // 000D JMPF R2 #0012 0x780A0003, // 000D JMPF R2 #0012
0x8C1C0319, // 000E GETMET R7 R1 K25 0x8C1C0316, // 000E GETMET R7 R1 K22
0x5C240400, // 000F MOVE R9 R2 0x5C240400, // 000F MOVE R9 R2
0x7C1C0400, // 0010 CALL R7 2 0x7C1C0400, // 0010 CALL R7 2
0x70020000, // 0011 JMP #0013 0x70020000, // 0011 JMP #0013
0x581C001A, // 0012 LDCONST R7 K26 0x581C0017, // 0012 LDCONST R7 K23
0x7C140400, // 0013 CALL R5 2 0x7C140400, // 0013 CALL R5 2
0x7C0C0400, // 0014 CALL R3 2 0x7C0C0400, // 0014 CALL R3 2
0x80000000, // 0015 RET 0 0x80000000, // 0015 RET 0
@ -237,9 +195,9 @@ be_local_closure(class_Matter_Plugin_Sensor_Occupancy_value_updated, /* name *
be_str_weak(value_updated), be_str_weak(value_updated),
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 5]) { /* code */ ( &(const binstruction[ 5]) { /* code */
0x8C04011B, // 0000 GETMET R1 R0 K27 0x8C040118, // 0000 GETMET R1 R0 K24
0x540E0405, // 0001 LDINT R3 1030 0x540E0405, // 0001 LDINT R3 1030
0x58100003, // 0002 LDCONST R4 K3 0x58100004, // 0002 LDCONST R4 K4
0x7C040600, // 0003 CALL R1 3 0x7C040600, // 0003 CALL R1 3
0x80000000, // 0004 RET 0 0x80000000, // 0004 RET 0
}) })
@ -257,9 +215,13 @@ be_local_class(Matter_Plugin_Sensor_Occupancy,
&be_class_Matter_Plugin_Sensor_Boolean, &be_class_Matter_Plugin_Sensor_Boolean,
be_nested_map(10, be_nested_map(10,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(update_virtual, 6), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_update_virtual_closure) }, { be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(263, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Occupancy) }, { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(Occupancy) },
{ be_const_key_weak(read_attribute, 5), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_read_attribute_closure) }, { be_const_key_weak(read_attribute, 6), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_read_attribute_closure) },
{ be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, { { be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1, be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) { ( (struct bvalue*) &(const bvalue[]) {
@ -275,12 +237,8 @@ be_local_class(Matter_Plugin_Sensor_Occupancy,
{ be_const_key_int(1030, 1), be_const_bytes_instance(000000010002FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(1030, 1), be_const_bytes_instance(000000010002FFF8FFF9FFFAFFFBFFFCFFFD) },
{ be_const_key_int(29, 0), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(29, 0), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(JSON_NAME, -1), be_nested_str_weak(Occupancy) },
{ be_const_key_weak(web_values, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_web_values_closure) }, { be_const_key_weak(web_values, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_web_values_closure) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(263, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_web_values_prefix_closure) }, { be_const_key_weak(web_values_prefix, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_web_values_prefix_closure) },
{ be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_value_updated_closure) }, { be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_Occupancy_value_updated_closure) },
{ be_const_key_weak(TYPE, 3), be_nested_str_weak(occupancy) }, { be_const_key_weak(TYPE, 3), be_nested_str_weak(occupancy) },

View File

@ -5,71 +5,23 @@
#include "be_constobj.h" #include "be_constobj.h"
// compact class 'Matter_Plugin_Sensor_OnOff' ktab size: 12, total: 14 (saved 16 bytes) // compact class 'Matter_Plugin_Sensor_OnOff' ktab size: 12, total: 14 (saved 16 bytes)
static const bvalue be_ktab_class_Matter_Plugin_Sensor_OnOff[12] = { static const bvalue be_ktab_class_Matter_Plugin_Sensor_OnOff[12] = {
/* K0 */ be_nested_str_weak(matter), /* K0 */ be_nested_str_weak(_X2C_X22OnOff_X22_X3A_X25s),
/* K1 */ be_nested_str_weak(TLV), /* K1 */ be_nested_str_weak(shadow_bool_value),
/* K2 */ be_nested_str_weak(cluster), /* K2 */ be_nested_str_weak(matter),
/* K3 */ be_nested_str_weak(attribute), /* K3 */ be_nested_str_weak(TLV),
/* K4 */ be_nested_str_weak(update_shadow_lazy), /* K4 */ be_nested_str_weak(cluster),
/* K5 */ be_const_int(0), /* K5 */ be_nested_str_weak(attribute),
/* K6 */ be_nested_str_weak(set), /* K6 */ be_nested_str_weak(update_shadow_lazy),
/* K7 */ be_nested_str_weak(BOOL), /* K7 */ be_const_int(0),
/* K8 */ be_nested_str_weak(shadow_bool_value), /* K8 */ be_nested_str_weak(set),
/* K9 */ be_nested_str_weak(read_attribute), /* K9 */ be_nested_str_weak(BOOL),
/* K10 */ be_nested_str_weak(_X2C_X22OnOff_X22_X3A_X25s), /* K10 */ be_nested_str_weak(read_attribute),
/* K11 */ be_nested_str_weak(attribute_updated), /* K11 */ be_nested_str_weak(attribute_updated),
}; };
extern const bclass be_class_Matter_Plugin_Sensor_OnOff; extern const bclass be_class_Matter_Plugin_Sensor_OnOff;
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_OnOff_read_attribute, /* name */
be_nested_proto(
12, /* nstack */
4, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_OnOff, /* shared constants */
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[25]) { /* code */
0xB8120000, // 0000 GETNGBL R4 K0
0x88100901, // 0001 GETMBR R4 R4 K1
0x88140502, // 0002 GETMBR R5 R2 K2
0x88180503, // 0003 GETMBR R6 R2 K3
0x541E0005, // 0004 LDINT R7 6
0x1C1C0A07, // 0005 EQ R7 R5 R7
0x781E0008, // 0006 JMPF R7 #0010
0x8C1C0104, // 0007 GETMET R7 R0 K4
0x7C1C0200, // 0008 CALL R7 1
0x1C1C0D05, // 0009 EQ R7 R6 K5
0x781E0004, // 000A JMPF R7 #0010
0x8C1C0706, // 000B GETMET R7 R3 K6
0x88240907, // 000C GETMBR R9 R4 K7
0x88280108, // 000D GETMBR R10 R0 K8
0x7C1C0600, // 000E CALL R7 3
0x80040E00, // 000F RET 1 R7
0x601C0003, // 0010 GETGBL R7 G3
0x5C200000, // 0011 MOVE R8 R0
0x7C1C0200, // 0012 CALL R7 1
0x8C1C0F09, // 0013 GETMET R7 R7 K9
0x5C240200, // 0014 MOVE R9 R1
0x5C280400, // 0015 MOVE R10 R2
0x5C2C0600, // 0016 MOVE R11 R3
0x7C1C0800, // 0017 CALL R7 4
0x80040E00, // 0018 RET 1 R7
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: append_state_json ** Solidified function: append_state_json
********************************************************************/ ********************************************************************/
@ -88,9 +40,9 @@ be_local_closure(class_Matter_Plugin_Sensor_OnOff_append_state_json, /* name *
&be_const_str_solidified, &be_const_str_solidified,
( &(const binstruction[ 7]) { /* code */ ( &(const binstruction[ 7]) { /* code */
0x60040018, // 0000 GETGBL R1 G24 0x60040018, // 0000 GETGBL R1 G24
0x5808000A, // 0001 LDCONST R2 K10 0x58080000, // 0001 LDCONST R2 K0
0x600C0009, // 0002 GETGBL R3 G9 0x600C0009, // 0002 GETGBL R3 G9
0x88100108, // 0003 GETMBR R4 R0 K8 0x88100101, // 0003 GETMBR R4 R0 K1
0x7C0C0200, // 0004 CALL R3 1 0x7C0C0200, // 0004 CALL R3 1
0x7C040400, // 0005 CALL R1 2 0x7C040400, // 0005 CALL R1 2
0x80040200, // 0006 RET 1 R1 0x80040200, // 0006 RET 1 R1
@ -100,6 +52,54 @@ be_local_closure(class_Matter_Plugin_Sensor_OnOff_append_state_json, /* name *
/*******************************************************************/ /*******************************************************************/
/********************************************************************
** Solidified function: read_attribute
********************************************************************/
be_local_closure(class_Matter_Plugin_Sensor_OnOff_read_attribute, /* name */
be_nested_proto(
12, /* nstack */
4, /* argc */
10, /* varg */
0, /* has upvals */
NULL, /* no upvals */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
&be_ktab_class_Matter_Plugin_Sensor_OnOff, /* shared constants */
be_str_weak(read_attribute),
&be_const_str_solidified,
( &(const binstruction[25]) { /* code */
0xB8120400, // 0000 GETNGBL R4 K2
0x88100903, // 0001 GETMBR R4 R4 K3
0x88140504, // 0002 GETMBR R5 R2 K4
0x88180505, // 0003 GETMBR R6 R2 K5
0x541E0005, // 0004 LDINT R7 6
0x1C1C0A07, // 0005 EQ R7 R5 R7
0x781E0008, // 0006 JMPF R7 #0010
0x8C1C0106, // 0007 GETMET R7 R0 K6
0x7C1C0200, // 0008 CALL R7 1
0x1C1C0D07, // 0009 EQ R7 R6 K7
0x781E0004, // 000A JMPF R7 #0010
0x8C1C0708, // 000B GETMET R7 R3 K8
0x88240909, // 000C GETMBR R9 R4 K9
0x88280101, // 000D GETMBR R10 R0 K1
0x7C1C0600, // 000E CALL R7 3
0x80040E00, // 000F RET 1 R7
0x601C0003, // 0010 GETGBL R7 G3
0x5C200000, // 0011 MOVE R8 R0
0x7C1C0200, // 0012 CALL R7 1
0x8C1C0F0A, // 0013 GETMET R7 R7 K10
0x5C240200, // 0014 MOVE R9 R1
0x5C280400, // 0015 MOVE R10 R2
0x5C2C0600, // 0016 MOVE R11 R3
0x7C1C0800, // 0017 CALL R7 4
0x80040E00, // 0018 RET 1 R7
})
)
);
/*******************************************************************/
/******************************************************************** /********************************************************************
** Solidified function: value_updated ** Solidified function: value_updated
********************************************************************/ ********************************************************************/
@ -119,7 +119,7 @@ be_local_closure(class_Matter_Plugin_Sensor_OnOff_value_updated, /* name */
( &(const binstruction[ 5]) { /* code */ ( &(const binstruction[ 5]) { /* code */
0x8C04010B, // 0000 GETMET R1 R0 K11 0x8C04010B, // 0000 GETMET R1 R0 K11
0x540E0005, // 0001 LDINT R3 6 0x540E0005, // 0001 LDINT R3 6
0x58100005, // 0002 LDCONST R4 K5 0x58100007, // 0002 LDCONST R4 K7
0x7C040600, // 0003 CALL R1 3 0x7C040600, // 0003 CALL R1 3
0x80000000, // 0004 RET 0 0x80000000, // 0004 RET 0
}) })
@ -135,9 +135,20 @@ extern const bclass be_class_Matter_Plugin_Sensor_Boolean;
be_local_class(Matter_Plugin_Sensor_OnOff, be_local_class(Matter_Plugin_Sensor_OnOff,
0, 0,
&be_class_Matter_Plugin_Sensor_Boolean, &be_class_Matter_Plugin_Sensor_Boolean,
be_nested_map(7, be_nested_map(9,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_weak(read_attribute, 1), be_const_closure(class_Matter_Plugin_Sensor_OnOff_read_attribute_closure) }, { be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(OnOff_X20Sensor) },
{ be_const_key_weak(append_state_json, 7), be_const_closure(class_Matter_Plugin_Sensor_OnOff_append_state_json_closure) },
{ be_const_key_weak(TYPES, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(2128, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(UPDATE_COMMANDS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_list, {
be_const_list( * be_nested_list(1,
( (struct bvalue*) &(const bvalue[]) {
be_nested_str_weak(OnOff),
})) ) } )) },
{ be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(CLUSTERS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, {
be_const_map( * be_nested_map(6, be_const_map( * be_nested_map(6,
( (struct bmapnode*) &(const bmapnode[]) { ( (struct bmapnode*) &(const bmapnode[]) {
@ -148,15 +159,10 @@ be_local_class(Matter_Plugin_Sensor_OnOff,
{ be_const_key_int(4, -1), be_const_bytes_instance(0000FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(4, -1), be_const_bytes_instance(0000FFF8FFF9FFFAFFFBFFFCFFFD) },
{ be_const_key_int(29, 1), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) }, { be_const_key_int(29, 1), be_const_bytes_instance(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD) },
})) ) } )) }, })) ) } )) },
{ be_const_key_weak(append_state_json, -1), be_const_closure(class_Matter_Plugin_Sensor_OnOff_append_state_json_closure) }, { be_const_key_weak(JSON_NAME, -1), be_nested_str_weak(OnOff) },
{ be_const_key_weak(TYPES, 6), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { { be_const_key_weak(read_attribute, -1), be_const_closure(class_Matter_Plugin_Sensor_OnOff_read_attribute_closure) },
be_const_map( * be_nested_map(1,
( (struct bmapnode*) &(const bmapnode[]) {
{ be_const_key_int(2128, -1), be_const_int(2) },
})) ) } )) },
{ be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_OnOff_value_updated_closure) },
{ be_const_key_weak(DISPLAY_NAME, -1), be_nested_str_weak(OnOff_X20Sensor) },
{ be_const_key_weak(TYPE, -1), be_nested_str_weak(onoff) }, { be_const_key_weak(TYPE, -1), be_nested_str_weak(onoff) },
{ be_const_key_weak(value_updated, -1), be_const_closure(class_Matter_Plugin_Sensor_OnOff_value_updated_closure) },
})), })),
be_str_weak(Matter_Plugin_Sensor_OnOff) be_str_weak(Matter_Plugin_Sensor_OnOff)
); );

Some files were not shown because too many files have changed in this diff Show More