Skip to content

Commit 61149b9

Browse files
committed
libs/iot_devices: Add SwitchC6 support.
Signed-off-by: lbuque <[email protected]>
1 parent bad154b commit 61149b9

File tree

13 files changed

+1122
-5
lines changed

13 files changed

+1122
-5
lines changed

docs/en/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"rui3",
6161
"m5audio2",
6262
"lvgl",
63+
"_espnow",
6364
]
6465

6566
autodoc_default_options = {

docs/en/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ UiFlow2 documentation and references
1616
units/index.rst
1717
hats/index.rst
1818
base/index.rst
19+
iot-devices/index.rst
1920
advanced/index.rst
2021
quick-reference/index.rst
2122
contribute/index.rst

docs/en/iot-devices/index.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
IoT Devices
2+
============
3+
4+
There is some support for M5Stack IoT devices. You can use the following modules to control them.
5+
6+
Modules
7+
-------
8+
9+
.. toctree::
10+
:maxdepth: 1
11+
12+
switchc6.rst

docs/en/iot-devices/switchc6.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
SwitchC6
2+
========
3+
4+
.. module:: switchc6
5+
:synopsis: A module for controlling the SwitchC6 device
6+
7+
.. include:: ../refs/iot-devices.switchc6.ref
8+
9+
The SwitchC6 is a device that can be controlled using the M5Stack platform. This module provides functions to interact with the SwitchC6 device.
10+
11+
UiFlow2 Example
12+
---------------
13+
14+
SwitchC6 Control
15+
^^^^^^^^^^^^^^^^
16+
17+
Open the |cores3_switchc6_example.m5f2| project in UiFlow2.
18+
19+
This example demonstrates how to control the SwitchC6 device using UiFlow2.
20+
21+
UiFlow2 Code Block:
22+
23+
|cores3_switchc6_example.png|
24+
25+
Example output:
26+
27+
None
28+
29+
30+
MicroPython Example
31+
-------------------
32+
33+
SwitchC6 Control
34+
^^^^^^^^^^^^^^^^
35+
36+
This example demonstrates how to control the SwitchC6 device using MicroPython.
37+
38+
MicroPython Code Block:
39+
40+
.. literalinclude:: ../../../examples/iot-devices/switchc6/cores3_switchc6_example.py
41+
:language: python
42+
:linenos:
43+
44+
Example output:
45+
46+
None
47+
48+
49+
**API**
50+
-------
51+
52+
SwitchC6Controller
53+
^^^^^^^^^^^^^^^^^^^
54+
55+
.. autoclass:: iot_devices.switchc6.SwitchC6Controller
56+
:members:
57+
:member-order: bysource

docs/en/refs/iot-devices.switchc6.ref

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
.. |event.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/event.png
3+
.. |get_capacitor_voltage.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/get_capacitor_voltage.png
4+
.. |get_firmware_version.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/get_firmware_version.png
5+
.. |get_switch_status.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/get_switch_status.png
6+
.. |init.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/init.png
7+
.. |set_switch.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/set_switch.png
8+
.. |toggle_switch.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/toggle.png
9+
10+
.. |cores3_switchc6_example.png| image:: https://static-cdn.m5stack.com/mpy_docs/iot_devices/switchc6/cores3_switchc6_example.png
11+
12+
.. |cores3_switchc6_example.m5f2| raw:: html
13+
14+
<a
15+
href="https://uiflow2.m5stack.com/?example=https://raw.githubusercontent.com/m5stack/uiflow-micropython/develop/examples/iot-devices/switchc6/cores3_switchc6_example.m5f2"
16+
target="_blank"
17+
>
18+
cores3_switchc6_example.m5f2
19+
</a>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2016 - 2025 M5Stack Technology Co., Ltd
3+
# This file is distributed under the same license as the UIFlow2 Programming
4+
# Guide package.
5+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
6+
#
7+
#, fuzzy
8+
msgid ""
9+
msgstr ""
10+
"Project-Id-Version: UIFlow2 Programming Guide \n"
11+
"Report-Msgid-Bugs-To: \n"
12+
"POT-Creation-Date: 2025-07-26 23:25+0800\n"
13+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15+
"Language: zh_CN\n"
16+
"Language-Team: zh_CN <[email protected]>\n"
17+
"Plural-Forms: nplurals=1; plural=0;\n"
18+
"MIME-Version: 1.0\n"
19+
"Content-Type: text/plain; charset=utf-8\n"
20+
"Content-Transfer-Encoding: 8bit\n"
21+
"Generated-By: Babel 2.17.0\n"
22+
23+
#: ../../en/iot-devices/index.rst:2 53d82994fd97409ca99db26bd0815b6b
24+
msgid "IoT Devices"
25+
msgstr ""
26+
27+
#: ../../en/iot-devices/index.rst:4 65453bf4be6f40fe894241f4e09bc321
28+
msgid ""
29+
"There is some support for M5Stack IoT devices. You can use the following "
30+
"modules to control them."
31+
msgstr ""
32+
"支持一些M5Stack物联网设备。您可以使用以下模块来控制它们。"
33+
34+
#: ../../en/iot-devices/index.rst:7 0393e339983241d5bb9915982043cb93
35+
msgid "Modules"
36+
msgstr ""
37+

0 commit comments

Comments
 (0)