Skip to content

docs: add hardware preflight check#10

Merged
fjoelnr merged 1 commit intodevelopfrom
codex/hivetech-hardware-preflight
Mar 22, 2026
Merged

docs: add hardware preflight check#10
fjoelnr merged 1 commit intodevelopfrom
codex/hivetech-hardware-preflight

Conversation

@fjoelnr
Copy link
Copy Markdown
Owner

@fjoelnr fjoelnr commented Mar 22, 2026

Summary

  • add a hardware preflight checker for HiveTech
  • document the preflight path in README, operations, verification, and status docs
  • make the current blockers explicit before OTA upload

Verification

  • python scripts/hardware_smoke_check.py

Current Preflight Result

  • missing local src/config.h
  • OTA target 192.168.178.89:3232 not reachable from this environment

@fjoelnr fjoelnr requested a review from ha-llm-bot as a code owner March 22, 2026 10:56
@fjoelnr fjoelnr merged commit ace8bdf into develop Mar 22, 2026
2 checks passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a hardware preflight check for the HiveTech project. This check validates the hardware configuration and network connectivity before performing an OTA upload. The changes include a new script, documentation updates, and explicit identification of potential blockers.

Highlights

  • Hardware Preflight Check: Introduces a new hardware preflight check script (hardware_smoke_check.py) to validate the configuration and connectivity of the HiveTech hardware before OTA uploads.
  • Documentation Updates: Updates the README, operations, verification, and status documents to include information about the new hardware preflight check.
  • Explicit Blocker Identification: Makes the current blockers (missing src/config.h and unreachable OTA target) explicit before OTA upload.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a hardware preflight check script and updates the documentation accordingly. The new script is a valuable addition for validating configurations before deployment. My review focuses on the new Python script, scripts/hardware_smoke_check.py, and includes suggestions to improve its robustness and maintainability. Specifically, I've pointed out an issue with how it handles PlatformIO environments, an unused import, and an opportunity to refactor for better readability.

import configparser
import re
import socket
import sys
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The sys module is imported but it is not used in the script. It's good practice to remove unused imports to keep the code clean.

Comment on lines +24 to +27
env_sections = [section for section in config.sections() if section.startswith("env:")]
if not env_sections:
raise ValueError("platformio.ini does not define an [env:*] section")
section = env_sections[0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The function _load_platformio_env currently selects the first [env:*] section from platformio.ini. This can be problematic if multiple environments are defined, as it might not be the intended one. To make this more robust, consider handling multiple environments, for example by allowing the user to specify an environment via a command-line argument. A simpler improvement would be to warn the user if more than one env: section is found.

Comment on lines +80 to +96
if not config_path.exists():
results.append(CheckResult("config.h", False, f"missing local config: {config_path}"))
else:
values = _read_config_values(config_path)
missing_keys = [key for key in ("ssid", "password", "mqtt_server") if key not in values]
if missing_keys:
results.append(CheckResult("config.h", False, f"missing keys: {', '.join(missing_keys)}"))
else:
placeholders = [key for key, value in values.items() if value in PLACEHOLDER_VALUES]
if placeholders:
results.append(CheckResult("config.h", False, f"placeholder values still set: {', '.join(placeholders)}"))
else:
results.append(CheckResult("config.h", True, "real local credentials/config detected"))

mqtt_host = values.get("mqtt_server", "")
if mqtt_host:
results.append(_check_host(mqtt_host, 1883))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for checking config.h is nested within an if/else block inside the main function. This reduces readability. Consider extracting this logic into a separate function to improve the structure and make main easier to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant