Skip to main content

HeishaMon Rules Minify

A Python CLI to minify Heishamon rules

HeishaMon is a project to read out a Panasonic air-water heat pump using an ESP8266 board. The HeishaMon firmware also supports the use of rules, to control the heatpump from within the HeishaMon itself. Since the ruleset must be stored within HeishaMon, its size must be limited. Therefore, it is best to use short function and variable names in order to maximize the number of rules that can be stored. Moreover, the rules library does not support comments in a ruleset, making it hard to read and maintain a ruleset, but also making it hard to share the ruleset with other.

This project aims to overcome these issues by making it possible write a ruleset with comments and descriptive function and variables names, and then minifying it. This way it is still possible to maximize the number of rules on the HeishaMon.

Note: The minifier should work for both the rule library used in version 3.2.3 and this updated rule libaray version. In the rule library from version 3.2.3, the elseif statement cannot be used

Installation

python3 -m pip install heishamon_rules_minify

Usage example

Start by creating a ruleset that adheres to the HeishaMon rules syntax, but can use the following extras:

  • Single line comments starting with -- or block comments between --[[ and ]].
  • Custom function and variable names will be minified to only keep the first letter (which will be capitalised) and capital letters, so for example #WaterTemperature will become #WT, #allowDHW will become #ADHW.

When the ruleset is finished, minify it using the following command:

heishamon-rules-minify [input_file] [output_file]

This will shorten all custom function and variable names and remove all unneeded spaces and newlines.

Extra options

There are a couple of extra options to pass with the minifier:

  • --print or -p to also print the output on the command line.
  • --comments_only or -c to only remove the comments from the input file but do no further minifying.

Release History

  • 0.0.1
    • Initial version
  • 0.0.2
    • Fix incorrect spacing for double operators, minor bugfixes
  • 0.0.3
    • Add option to only remove comments
  • 0.0.4
    • Fix extra space being added after the minus sign of negative values

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Metadata

Release files for heishamon-rules-minify 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for heishamon-rules-minify 0.0.4
File Size Uploaded Provenance
heishamon_rules_minify-0.0.4.tar.gz 10.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for heishamon-rules-minify 0.0.4
File Interpreter ABI Platform
heishamon_rules_minify-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 18.2 kB

Release files / heishamon_rules_minify-0.0.4.tar.gz

Download URL heishamon_rules_minify-0.0.4.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
95c6029940220ac621d1ea03943589c8fc3c7ca0e6186c1c99c14827345c39dc
BLAKE2b-256 checksum
How to use checksums
2fe04bd29eb94015ee21ed62d2aa74f003dd253605873bb1053fc2e89f7028c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2024.

Transparency log

Release files / heishamon_rules_minify-0.0.4-py3-none-any.whl

Download URL heishamon_rules_minify-0.0.4-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c77ca39d2a7dcdae1296995c866c696e296dc68e756f5fdae33ec87b027e24a
BLAKE2b-256 checksum
How to use checksums
4c96e9656f90e62dc193b20cb38a0fe6022e7043ab1baa1c7128cae76e86f920
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2024.

Transparency log

Security for heishamon-rules-minify 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for heishamon_rules_minify-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page