Acceleration is not included: class and units are missing: homeassistant/const.py

This is an EASY fix… and one that would add another layer towards completeness… We measure Acceleration in ft/sec^2, cm/sec^2, etc. We ought to be able to reference this natively in HA.

As this is the 21 century and Physics is a well-established branch of science, it makes sense that we can measure acceleration in the home.

Add m/sec^2, in/sec^2, cm/sec^2 etc. These would all be analogous to the SPEED units except for the Beaufort scale and Knots units.

Also add the class for ACCELERATION.

SensorDeviceClass.ACCELERATION : ft/s², in/h², in/s², km/h², kn², m/s², mph², mm/s² : Generic acceleration

Acceleration units

class UnitOfAcceleration(StrEnum):
“”“Acceleration units.”“”

FEET_PER_SECOND_PER_SECOND = "ft/s²"
INCHES_PER_SECOND_PER_SECOND = "in/s²"
METERS_PER_SECOND_PER_SECOND = "m/s²"
KILOMETERS_PER_HOUR_PER_HOUR = "km/h²"
MILES_PER_HOUR_PER_HOUR = "mph/h²"
MILLIMETERS_PER_SECOND_PER_SECOND = "mm/s²"

As this is the 21 century and physics is a well-established branch of science, it makes sense that we can measure acceleration in the home.

Examples: Seismographs, Movement “Noise” in house (heavy equipment nearby moving), accelerometer (my own use case it to monitor a mouse trap in our basement crawl space … and I get a text when it has been triggered/it goes “off”).

Thanks!

Creata a PR!

3 Likes

@nickrout, if I create the PR, will someone there guide me through the steps to get it accepted…?

I’m in chemotherapy right now (no weeping violin music in the background; its just factual - and the chemo-induced brain fog doesn’t make it easier; not looking for sympathy, but rather trying to be careful w/ what energy I have at the moment…)

Should it be a patch/diff?

How do I test it w/o wrecking my own HA system?

1 Like

Sorry to hear about the chemo, awful.

Basically you need to git clone the ha repository, make your change and then do a pr.

Depends how familiar you are with GitHub…

To test your changes, you need to run HA core in devcontainer. You may fork HA core, then create a GitHub codespace for your fork, then connect to this codespace from VScode installed on your PC.
Then in VScode you will see a directory tree for source code. Run a task (honestly do not remember how it called) from VScode “Terminal” menu to start HA in devcontainer.
Then you can add changes in a source code locally in VScode, test it locally, then create PR.

Of course you may just create a PR without testing it, but this not a good way.

1 Like

Listen to @Ildar_Gabdullin rather than me!!

1 Like