mirror of
https://github.com/home-assistant/frontend.git
synced 2026-08-26 16:15:52 +01:00
* Expand sensor entity constants and add device classes * Updated constants * Fix typo * Fix name * Restore part original generated script comment * Add convertible units and fix null type * Fix type * Update constants * Fix import SENSOR_NUMERIC_DEVICE_CLASSES
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: Sync sensor entity constants
|
|
|
|
# Mirrors Home Assistant Core's numeric `SensorDeviceClass`, `SensorStateClass`,
|
|
# units and related device and state classes arrays into the
|
|
# build-time default in src/data/sensor_entity_constants.ts and opens a PR
|
|
# when it drifts. Reads homeassistant/generated/sensor.json from core.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 4 * * *" # Daily, 04:00 UTC
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
sync:
|
|
name: Sync
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup Node and install
|
|
uses: ./.github/actions/setup
|
|
|
|
- name: Regenerate sensor entity constants
|
|
run: ./script/gen_sensor_entity_constants
|
|
|
|
- name: Format
|
|
run: yarn prettier --write src/data/sensor_numeric_device_classes.ts
|
|
|
|
- name: Create pull request
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
with:
|
|
branch: chore/sync-numeric-device-classes
|
|
commit-message: Update numeric sensor device classes
|
|
title: Update numeric sensor device classes
|
|
body: |
|
|
Regenerated `SENSOR_NUMERIC_DEVICE_CLASSES` from Home Assistant Core's
|
|
`SensorDeviceClass`.
|
|
|
|
Automated by `.github/workflows/sync-numeric-device-classes.yaml`.
|