Public Access
chore: small improvements
Signed-off-by: bullshit <coding@ow-software.pl>
This commit is contained in:
4 files changed
+15
-6
No files matched your search
@@ -35,7 +35,7 @@
|
|||||||
"ms-vscode.cmake-tools",
|
"ms-vscode.cmake-tools",
|
||||||
"esphome.esphome-vscode",
|
"esphome.esphome-vscode",
|
||||||
"platformio.platformio-ide",
|
"platformio.platformio-ide",
|
||||||
"ms-vscode.hexeditor"
|
"ms-vscode.vscode-serial-monitor"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
"python.defaultInterpreterPath": "/usr/local/bin/python",
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pip install --upgrade esphome
|
|||||||
|
|
||||||
# Claude Code - MCP server
|
# Claude Code - MCP server
|
||||||
sudo -u esphome bash -c "curl -fsSL https://claude.ai/install.sh | bash -s latest"
|
sudo -u esphome bash -c "curl -fsSL https://claude.ai/install.sh | bash -s latest"
|
||||||
sudo -u esphome bash -c "~/.local/bin/claude mcp add code npx \"@steipete/claude-code-mcp\" \"/workspace\""
|
sudo -u esphome bash -c "/home/esphome/.local/bin/claude mcp add code npx \"@steipete/claude-code-mcp\" \"/workspace\""
|
||||||
|
|
||||||
# Set up USB permissions
|
# Set up USB permissions
|
||||||
cat > /etc/udev/rules.d/99-esphome-usb.rules << 'UDEV_EOF'
|
cat > /etc/udev/rules.d/99-esphome-usb.rules << 'UDEV_EOF'
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ tools/
|
|||||||
└── README.md # Tools documentation
|
└── README.md # Tools documentation
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
└── tasks.json # VSCode development tasks
|
├── tasks.json # VSCode development tasks
|
||||||
```
|
```
|
||||||
|
|
||||||
### Development Tools
|
### Development Tools
|
||||||
|
|||||||
+12
-3
@@ -1,10 +1,12 @@
|
|||||||
# Development Tools
|
# Development Tools
|
||||||
|
|
||||||
This folder contains development tools for the UPS HID ESPHome component.
|
This folder contains development tools for ESP32 ESPHome component development, including debugging utilities and vendor management tools.
|
||||||
|
|
||||||
## scan-usb.sh
|
## USB Device Management
|
||||||
|
|
||||||
This script lists esp and ups releated usb devices.
|
### scan-usb.sh
|
||||||
|
|
||||||
|
Lists ESP32, UPS, and related USB devices connected to the system. Useful for identifying device paths and vendor/product IDs during development.
|
||||||
|
|
||||||
## generate_vendor_list.py
|
## generate_vendor_list.py
|
||||||
|
|
||||||
@@ -13,6 +15,7 @@ This script keeps the UPS vendor ID lists synchronized between C++, scripts and
|
|||||||
### Purpose
|
### Purpose
|
||||||
|
|
||||||
The UPS HID component maintains a list of known UPS vendor IDs in two places:
|
The UPS HID component maintains a list of known UPS vendor IDs in two places:
|
||||||
|
|
||||||
- `components/ups_hid/ups_vendors.h` (C++ runtime code)
|
- `components/ups_hid/ups_vendors.h` (C++ runtime code)
|
||||||
- `components/ups_hid/__init__.py` (Python configuration validation)
|
- `components/ups_hid/__init__.py` (Python configuration validation)
|
||||||
|
|
||||||
@@ -21,12 +24,14 @@ This script extracts the vendor list from the C++ header file and updates the Py
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
#### Command Line
|
#### Command Line
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /workspace
|
cd /workspace
|
||||||
python3 tools/generate_vendor_list.py
|
python3 tools/generate_vendor_list.py
|
||||||
```
|
```
|
||||||
|
|
||||||
#### VSCode Task
|
#### VSCode Task
|
||||||
|
|
||||||
1. Open the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)
|
1. Open the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)
|
||||||
2. Type "Tasks: Run Task"
|
2. Type "Tasks: Run Task"
|
||||||
3. Select "Generate UPS Vendor List"
|
3. Select "Generate UPS Vendor List"
|
||||||
@@ -36,6 +41,7 @@ Or use the keyboard shortcut `Ctrl+Shift+P` -> "Tasks: Run Build Task" and selec
|
|||||||
### When to Run
|
### When to Run
|
||||||
|
|
||||||
Run this script whenever you:
|
Run this script whenever you:
|
||||||
|
|
||||||
1. Add new UPS vendor IDs to `components/ups_hid/ups_vendors.h`
|
1. Add new UPS vendor IDs to `components/ups_hid/ups_vendors.h`
|
||||||
2. Modify existing vendor information
|
2. Modify existing vendor information
|
||||||
3. Want to ensure the C++ and Python lists are synchronized
|
3. Want to ensure the C++ and Python lists are synchronized
|
||||||
@@ -43,6 +49,7 @@ Run this script whenever you:
|
|||||||
### Output
|
### Output
|
||||||
|
|
||||||
The script will:
|
The script will:
|
||||||
|
|
||||||
- Parse the C++ header file for vendor definitions
|
- Parse the C++ header file for vendor definitions
|
||||||
- Extract vendor IDs, names, and descriptions
|
- Extract vendor IDs, names, and descriptions
|
||||||
- Update the `KNOWN_VENDOR_IDS` dictionary in `__init__.py`
|
- Update the `KNOWN_VENDOR_IDS` dictionary in `__init__.py`
|
||||||
@@ -62,9 +69,11 @@ To add a new UPS vendor:
|
|||||||
|
|
||||||
1. Edit `components/ups_hid/ups_vendors.h`
|
1. Edit `components/ups_hid/ups_vendors.h`
|
||||||
2. Add a new entry to the `KNOWN_UPS_VENDORS` array:
|
2. Add a new entry to the `KNOWN_UPS_VENDORS` array:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
{0x1234, "New Vendor", "New Vendor Description"},
|
{0x1234, "New Vendor", "New Vendor Description"},
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run the generate_vendor_list.py script to update the Python file
|
3. Run the generate_vendor_list.py script to update the Python file
|
||||||
4. Compile and test the component
|
4. Compile and test the component
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user