diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 9deb34d20e9..00000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: https://www.openhomefoundation.org diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 792dacd8032..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,112 +0,0 @@ - -## Breaking change - - - -## Proposed change - - - -## Type of change - - -- [ ] Dependency upgrade -- [ ] Bugfix (non-breaking change which fixes an issue) -- [ ] New integration (thank you!) -- [ ] New feature (which adds functionality to an existing integration) -- [ ] Deprecation (breaking change to happen in the future) -- [ ] Breaking change (fix/feature causing existing functionality to break) -- [ ] Code quality improvements to existing code or addition of tests - -## Additional information - - -- This PR fixes or closes issue: fixes # -- This PR is related to issue: -- Link to documentation pull request: -- Link to developer documentation pull request: -- Link to frontend pull request: - -## Checklist - - -- [ ] The code change is tested and works locally. -- [ ] Local tests pass. **Your PR cannot be merged unless tests pass** -- [ ] There is no commented out code in this PR. -- [ ] I have followed the [development checklist][dev-checklist] -- [ ] I have followed the [perfect PR recommendations][perfect-pr] -- [ ] The code has been formatted using Ruff (`ruff format homeassistant tests`) -- [ ] Tests have been added to verify that the new code works. - -If user exposed functionality or configuration variables are added/changed: - -- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository] - -If the code communicates with devices, web services, or third-party tools: - -- [ ] The [manifest file][manifest-docs] has all fields filled out correctly. - Updated and included derived files by running: `python3 -m script.hassfest`. -- [ ] New or updated dependencies have been added to `requirements_all.txt`. - Updated by running `python3 -m script.gen_requirements_all`. -- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description. - - - -To help with the load of incoming pull requests: - -- [ ] I have reviewed two other [open pull requests][prs] in this repository. - -[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure - - -[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/ -[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/ -[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/ -[docs-repository]: https://github.com/home-assistant/home-assistant.io -[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr diff --git a/.github/assets/screenshot-integrations.png b/.github/assets/screenshot-integrations.png deleted file mode 100644 index abbc0f76ff0..00000000000 Binary files a/.github/assets/screenshot-integrations.png and /dev/null differ diff --git a/.github/assets/screenshot-states.png b/.github/assets/screenshot-states.png deleted file mode 100644 index 15b527661a4..00000000000 Binary files a/.github/assets/screenshot-states.png and /dev/null differ diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 5ac2e47789b..82009751763 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -324,7 +324,7 @@ jobs: uses: actions/checkout@v4.2.2 - name: Install Cosign - uses: sigstore/cosign-installer@v3.9.1 + uses: sigstore/cosign-installer@v3.9.2 with: cosign-release: "v2.2.3" diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index fb5deb2958f..00000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Lock - -# yamllint disable-line rule:truthy -on: - schedule: - - cron: "0 * * * *" - -jobs: - lock: - if: github.repository_owner == 'home-assistant' - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v5.0.1 - with: - github-token: ${{ github.token }} - issue-inactive-days: "30" - exclude-issue-created-before: "2020-10-01T00:00:00Z" - issue-lock-reason: "" - pr-inactive-days: "1" - exclude-pr-created-before: "2020-11-01T00:00:00Z" - pr-lock-reason: "" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..0938657eed1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: "Release" + +on: + release: + types: + - "published" + +permissions: {} + +jobs: + release: + name: "Release" + runs-on: "ubuntu-latest" + permissions: + contents: write + steps: + - name: "Github Releases To Discord" + uses: SethCohen/github-releases-to-discord@v1.16.2 + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + username: "Teslemetry release for HACS" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 11c87266525..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: Stale - -# yamllint disable-line rule:truthy -on: - schedule: - - cron: "0 * * * *" - workflow_dispatch: - -jobs: - stale: - if: github.repository_owner == 'home-assistant' - runs-on: ubuntu-latest - steps: - # The 60 day stale policy for PRs - # Used for: - # - PRs - # - No PRs marked as no-stale - # - No issues (-1) - - name: 60 days stale PRs policy - uses: actions/stale@v9.1.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 60 - days-before-close: 7 - days-before-issue-stale: -1 - days-before-issue-close: -1 - operations-per-run: 150 - remove-stale-when-updated: true - stale-pr-label: "stale" - exempt-pr-labels: "no-stale" - stale-pr-message: > - There hasn't been any activity on this pull request recently. This - pull request has been automatically marked as stale because of that - and will be closed if no further activity occurs within 7 days. - - If you are the author of this PR, please leave a comment if you want - to keep it open. Also, please rebase your PR onto the latest dev - branch to ensure that it's up to date with the latest changes. - - Thank you for your contribution! - - # Generate a token for the GitHub App, we use this method to avoid - # hitting API limits for our GitHub actions + have a higher rate limit. - # This is only used for issues. - - name: Generate app token - id: token - # Pinned to a specific version of the action for security reasons - # v1.7.0 - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a - with: - app_id: ${{ secrets.ISSUE_TRIAGE_APP_ID }} - private_key: ${{ secrets.ISSUE_TRIAGE_APP_PEM }} - - # The 90 day stale policy for issues - # Used for: - # - Issues - # - No issues marked as no-stale or help-wanted - # - No PRs (-1) - - name: 90 days stale issues - uses: actions/stale@v9.1.0 - with: - repo-token: ${{ steps.token.outputs.token }} - days-before-stale: 90 - days-before-close: 7 - days-before-pr-stale: -1 - days-before-pr-close: -1 - operations-per-run: 250 - remove-stale-when-updated: true - stale-issue-label: "stale" - exempt-issue-labels: "no-stale,help-wanted,needs-more-information" - stale-issue-message: > - There hasn't been any activity on this issue recently. Due to the - high number of incoming GitHub notifications, we have to clean some - of the old issues, as many of them have already been resolved with - the latest updates. - - Please make sure to update to the latest Home Assistant version and - check if that solves the issue. Let us know if that works for you by - adding a comment 👍 - - This issue has now been marked as stale and will be closed if no - further activity occurs. Thank you for your contributions. - - # The 30 day stale policy for issues - # Used for: - # - Issues that are pending more information (incomplete issues) - # - No Issues marked as no-stale or help-wanted - # - No PRs (-1) - - name: Needs more information stale issues policy - uses: actions/stale@v9.1.0 - with: - repo-token: ${{ steps.token.outputs.token }} - only-labels: "needs-more-information" - days-before-stale: 14 - days-before-close: 7 - days-before-pr-stale: -1 - days-before-pr-close: -1 - operations-per-run: 250 - remove-stale-when-updated: true - stale-issue-label: "stale" - exempt-issue-labels: "no-stale,help-wanted" - stale-issue-message: > - There hasn't been any activity on this issue recently. Due to the - high number of incoming GitHub notifications, we have to clean some - of the old issues, as many of them have already been resolved with - the latest updates. - - Please make sure to update to the latest Home Assistant version and - check if that solves the issue. Let us know if that works for you by - adding a comment 👍 - - This issue has now been marked as stale and will be closed if no - further activity occurs. Thank you for your contributions. diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000000..37b38002643 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,37 @@ +name: "Validate" + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + push: + branches: + - "main" + pull_request: + branches: + - "main" + +jobs: + hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest + name: "Hassfest Validation" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout the repository" + uses: "actions/checkout@v4.2.2" + + - name: "Run hassfest validation" + uses: "home-assistant/actions/hassfest@master" + + hacs: # https://github.com/hacs/action + name: "HACS Validation" + runs-on: "ubuntu-latest" + steps: + - name: "Checkout the repository" + uses: "actions/checkout@v4.2.2" + + - name: "Run HACS validation" + uses: "hacs/action@main" + with: + category: "integration" + # Remove this 'ignore' key when you have added brand images for your integration to https://github.com/home-assistant/brands + ignore: "brands" diff --git a/.gitignore b/.gitignore index 9bcf440a2f1..4babed1fc2b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ data/ # Translations homeassistant/components/*/translations +!homeassistant/components/teslemetry/translations # Hide sublime text stuff *.sublime-project @@ -142,3 +143,4 @@ pytest_buckets.txt # AI tooling .claude +release_notes.txt diff --git a/README.md b/README.md new file mode 100644 index 00000000000..7ec330231ad --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Teslemetry + +[![GitHub Release][releases-shield]][releases] +[![GitHub Activity][commits-shield]][commits] +[![License][license-shield]](LICENSE) + +![Project Maintenance][maintenance-shield] + +[![Discord][discord-shield]][discord] + +**This integration requires a subscription and access token from Teslemetry.com** + +## HACS + +[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=Teslemetry&repository=hass-teslemetry&category=integration) + +1. Install and setup HACS. https://hacs.xyz/docs/user +2. Add https://github.com/Teslemetry/hass-teslemetry as a repo (or click the link above). +3. Search for Teslemetry and install. +4. Restart Home Assistant + +**Checkout the full documentation at https://teslemetry.com/docs/home-assistant/features** + + + + +*** + +[commits-shield]: https://img.shields.io/github/commit-activity/y/Teslemetry/hacs-teslemetry.svg?style=for-the-badge +[commits]: https://github.com/teslemetry/hacs-teslemetry/commits/main +[discord]: https://discord.gg/7wZwHaZbWD +[discord-shield]: https://img.shields.io/discord/1197069901664358460.svg?style=for-the-badge +[license-shield]: https://img.shields.io/github/license/teslemetry/hacs-teslemetry.svg?style=for-the-badge +[maintenance-shield]: https://img.shields.io/badge/maintainer-Brett%20Adams%20%40Bre77-blue.svg?style=for-the-badge +[releases-shield]: https://img.shields.io/github/release/teslemetry/hacs-teslemetry.svg?style=for-the-badge +[releases]: https://github.com/teslemetry/hacs-teslemetry/releases diff --git a/README.rst b/README.rst deleted file mode 100644 index 85c632f7eb1..00000000000 --- a/README.rst +++ /dev/null @@ -1,33 +0,0 @@ -Home Assistant |Chat Status| -================================================================================= - -Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. - -Check out `home-assistant.io `__ for `a -demo `__, `installation instructions `__, -`tutorials `__ and `documentation `__. - -|screenshot-states| - -Featured integrations ---------------------- - -|screenshot-integrations| - -The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture `__ and the `section on creating your own -components `__. - -If you run into issues while using Home Assistant or during development -of a component, check the `Home Assistant help section `__ of our website for further help and information. - -|ohf-logo| - -.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg - :target: https://www.home-assistant.io/join-chat/ -.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-states.png - :target: https://demo.home-assistant.io -.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-integrations.png - :target: https://home-assistant.io/integrations/ -.. |ohf-logo| image:: https://www.openhomefoundation.org/badges/home-assistant.png - :alt: Home Assistant - A project from the Open Home Foundation - :target: https://www.openhomefoundation.org/ diff --git a/custom_components/teslemetry/manifest.json b/custom_components/teslemetry/manifest.json new file mode 100644 index 00000000000..2ea084b2769 --- /dev/null +++ b/custom_components/teslemetry/manifest.json @@ -0,0 +1,11 @@ +{ + "version": "4.0.0", + "domain": "teslemetry", + "name": "Teslemetry", + "codeowners": ["@Bre77"], + "config_flow": true, + "documentation": "https://www.home-assistant.io/integrations/teslemetry", + "iot_class": "cloud_polling", + "loggers": ["tesla-fleet-api"], + "requirements": ["tesla-fleet-api==1.0.17", "teslemetry-stream==0.7.1"] +} diff --git a/hacs.json b/hacs.json new file mode 100644 index 00000000000..0ce18697992 --- /dev/null +++ b/hacs.json @@ -0,0 +1,8 @@ +{ + "name": "Teslemetry", + "filename": "teslemetry.zip", + "hide_default_branch": true, + "homeassistant": "2025.6.0", + "render_readme": true, + "zip_release": true +} diff --git a/homeassistant/components/teslemetry/manifest.json b/homeassistant/components/teslemetry/manifest.json index d12cf278d59..f74af73c629 100644 --- a/homeassistant/components/teslemetry/manifest.json +++ b/homeassistant/components/teslemetry/manifest.json @@ -4,6 +4,7 @@ "codeowners": ["@Bre77"], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/teslemetry", + "issue_tracker": "https://github.com/Teslemetry/hass-teslemetry/issues", "iot_class": "cloud_polling", "loggers": ["tesla-fleet-api"], "requirements": ["tesla-fleet-api==1.2.2", "teslemetry-stream==0.7.9"] diff --git a/homeassistant/components/teslemetry/translations/en.json b/homeassistant/components/teslemetry/translations/en.json new file mode 100644 index 00000000000..48eb6540ed9 --- /dev/null +++ b/homeassistant/components/teslemetry/translations/en.json @@ -0,0 +1,1229 @@ +{ + "config": { + "abort": { + "already_configured": "Account is already configured", + "reauth_account_mismatch": "The reauthentication account does not match the original account", + "reauth_successful": "Re-authentication was successful" + }, + "error": { + "cannot_connect": "Failed to connect", + "invalid_access_token": "Invalid access token", + "subscription_required": "Subscription required, please visit {short_url}", + "unknown": "Unexpected error" + }, + "step": { + "reauth_confirm": { + "data": { + "access_token": "Access token" + }, + "description": "The {name} integration needs to re-authenticate your account, please enter an access token from {url}", + "title": "Authentication expired for {name}" + }, + "user": { + "data": { + "access_token": "Access token" + }, + "description": "Enter an access token from {url}." + } + } + }, + "entity": { + "binary_sensor": { + "automatic_blind_spot_camera": { + "name": "Automatic blind spot camera" + }, + "automatic_emergency_braking_off": { + "name": "Automatic emergency braking off" + }, + "backup_capable": { + "name": "Backup capable" + }, + "blind_spot_collision_warning_chime": { + "name": "Blind spot collision warning chime" + }, + "bms_full_charge_complete": { + "name": "BMS full charge" + }, + "brake_pedal": { + "name": "Brake pedal" + }, + "cellular": { + "name": "Cellular" + }, + "charge_enable_request": { + "name": "Charge enable request" + }, + "charge_port_cold_weather_mode": { + "name": "Charge port cold weather mode" + }, + "charge_state_battery_heater_on": { + "name": "Battery heater" + }, + "charge_state_charger_phases": { + "name": "Charger has multiple phases" + }, + "charge_state_conn_charge_cable": { + "name": "Charge cable" + }, + "charge_state_preconditioning_enabled": { + "name": "Preconditioning enabled" + }, + "charge_state_scheduled_charging_pending": { + "name": "Scheduled charging pending" + }, + "charge_state_trip_charging": { + "name": "Trip charging" + }, + "climate_state_cabin_overheat_protection_actively_cooling": { + "name": "Cabin overheat protection active" + }, + "climate_state_is_preconditioning": { + "name": "Preconditioning" + }, + "components_grid_services_enabled": { + "name": "Grid services enabled" + }, + "dc_dc_enable": { + "name": "DC to DC converter" + }, + "defrost_for_preconditioning": { + "name": "Defrost for preconditioning" + }, + "drive_rail": { + "name": "Drive rail" + }, + "driver_seat_belt": { + "name": "Driver seat belt" + }, + "driver_seat_occupied": { + "name": "Driver seat occupied" + }, + "emergency_lane_departure_avoidance": { + "name": "Emergency lane departure avoidance" + }, + "europe_vehicle": { + "name": "European vehicle" + }, + "fast_charger_present": { + "name": "Fast charger present" + }, + "gps_state": { + "name": "GPS state" + }, + "grid_services_active": { + "name": "Grid services active" + }, + "guest_mode_enabled": { + "name": "Guest mode enabled" + }, + "homelink_nearby": { + "name": "Homelink nearby" + }, + "hvac_auto_mode": { + "name": "HVAC auto mode" + }, + "hvil": { + "name": "High voltage interlock loop fault" + }, + "lights_high_beams": { + "name": "High beams" + }, + "located_at_favorite": { + "name": "Located at favorite" + }, + "located_at_home": { + "name": "Located at home" + }, + "located_at_work": { + "name": "Located at work" + }, + "offroad_lightbar_present": { + "name": "Offroad lightbar" + }, + "passenger_seat_belt": { + "name": "Passenger seat belt" + }, + "pin_to_drive_enabled": { + "name": "PIN to Drive enabled" + }, + "rear_display_hvac_enabled": { + "name": "Rear display HVAC" + }, + "remote_start_enabled": { + "name": "Remote start" + }, + "right_hand_drive": { + "name": "Right hand drive" + }, + "seat_vent_enabled": { + "name": "Seat vent enabled" + }, + "service_mode": { + "name": "Service mode" + }, + "speed_limit_mode": { + "name": "Speed limited" + }, + "state": { + "name": "Status" + }, + "storm_mode_active": { + "name": "Storm watch active" + }, + "supercharger_session_trip_planner": { + "name": "Supercharger session trip planner" + }, + "vehicle_state_dashcam_state": { + "name": "Dashcam" + }, + "vehicle_state_df": { + "name": "Front driver door" + }, + "vehicle_state_dr": { + "name": "Rear driver door" + }, + "vehicle_state_fd_window": { + "name": "Front driver window" + }, + "vehicle_state_fp_window": { + "name": "Front passenger window" + }, + "vehicle_state_is_user_present": { + "name": "User present" + }, + "vehicle_state_pf": { + "name": "Front passenger door" + }, + "vehicle_state_pr": { + "name": "Rear passenger door" + }, + "vehicle_state_rd_window": { + "name": "Rear driver window" + }, + "vehicle_state_rp_window": { + "name": "Rear passenger window" + }, + "vehicle_state_tpms_soft_warning_fl": { + "name": "Tire pressure warning front left" + }, + "vehicle_state_tpms_soft_warning_fr": { + "name": "Tire pressure warning front right" + }, + "vehicle_state_tpms_soft_warning_rl": { + "name": "Tire pressure warning rear left" + }, + "vehicle_state_tpms_soft_warning_rr": { + "name": "Tire pressure warning rear right" + }, + "wifi": { + "name": "Wi-Fi" + }, + "wiper_heat_enabled": { + "name": "Wiper heat" + } + }, + "button": { + "boombox": { + "name": "Play fart" + }, + "enable_keyless_driving": { + "name": "Keyless driving" + }, + "flash_lights": { + "name": "Flash lights" + }, + "homelink": { + "name": "Homelink" + }, + "honk": { + "name": "Honk horn" + }, + "wake": { + "name": "Wake" + } + }, + "calendar": { + "charge_schedule_data_charge_schedules": { + "name": "Charging schedule" + }, + "preconditioning_schedule_data_precondition_schedules": { + "name": "Precondition schedule" + }, + "tariff_content_v2": { + "name": "Buy tariff" + }, + "tariff_content_v2_sell_tariff": { + "name": "Sell tariff" + } + }, + "climate": { + "climate_state_cabin_overheat_protection": { + "name": "Cabin overheat protection" + }, + "driver_temp": { + "name": "Climate", + "state_attributes": { + "fan_mode": { + "state": { + "bioweapon": "Bioweapon defense", + "off": "Off" + } + }, + "preset_mode": { + "state": { + "camp": "Camp mode", + "dog": "Dog mode", + "keep": "Keep mode", + "off": "Normal" + } + } + } + } + }, + "cover": { + "charge_state_charge_port_door_open": { + "name": "Charge port door" + }, + "vehicle_state_ft": { + "name": "Frunk" + }, + "vehicle_state_rt": { + "name": "Trunk" + }, + "vehicle_state_sun_roof_state": { + "name": "Sunroof" + }, + "windows": { + "name": "Windows" + } + }, + "device_tracker": { + "location": { + "name": "Location" + }, + "origin": { + "name": "Origin" + }, + "route": { + "name": "Route" + } + }, + "lock": { + "charge_state_charge_port_latch": { + "name": "Charge cable lock" + }, + "vehicle_state_locked": { + "name": "Lock" + }, + "vehicle_state_speed_limit_mode_active": { + "name": "Speed limit" + } + }, + "media_player": { + "media": { + "name": "Media player" + } + }, + "number": { + "backup_reserve_percent": { + "name": "Backup reserve" + }, + "charge_state_charge_current_request": { + "name": "Charge current" + }, + "charge_state_charge_limit_soc": { + "name": "Charge limit" + }, + "off_grid_vehicle_charging_reserve_percent": { + "name": "Off-grid reserve" + } + }, + "select": { + "climate_state_seat_heater_left": { + "name": "Seat heater front left", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_rear_center": { + "name": "Seat heater rear center", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_rear_left": { + "name": "Seat heater rear left", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_rear_right": { + "name": "Seat heater rear right", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_right": { + "name": "Seat heater front right", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_third_row_left": { + "name": "Seat heater third row left", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_seat_heater_third_row_right": { + "name": "Seat heater third row right", + "state": { + "high": "High", + "low": "Low", + "medium": "Medium", + "off": "Off" + } + }, + "climate_state_steering_wheel_heat_level": { + "name": "Steering wheel heater", + "state": { + "high": "High", + "low": "Low", + "off": "Off" + } + }, + "components_customer_preferred_export_rule": { + "name": "Allow export", + "state": { + "battery_ok": "Battery", + "never": "Never", + "pv_only": "Solar only" + } + }, + "default_real_mode": { + "name": "Operation mode", + "state": { + "autonomous": "Autonomous", + "backup": "Backup", + "self_consumption": "Self consumption" + } + } + }, + "sensor": { + "battery_energy_exported": { + "name": "Battery exported" + }, + "battery_energy_imported_from_generator": { + "name": "Battery imported from generator" + }, + "battery_energy_imported_from_grid": { + "name": "Battery imported from grid" + }, + "battery_energy_imported_from_solar": { + "name": "Battery imported from solar" + }, + "battery_power": { + "name": "Battery power" + }, + "bms_state": { + "name": "BMS state", + "state": { + "charge": "Charge", + "clear_fault": "Clear fault", + "drive": "Drive", + "fault": "Fault", + "full_electric_in_motion": "Full electric in motion", + "standby": "Standby", + "support": "Support", + "system_not_available": "System not available", + "test": "Test", + "weld": "Weld" + } + }, + "brake_pedal_position": { + "name": "Brake pedal position" + }, + "brick_voltage_max": { + "name": "Brick voltage max" + }, + "brick_voltage_min": { + "name": "Brick voltage min" + }, + "charge_rate_mile_per_hour": { + "name": "Charge rate" + }, + "charge_state_battery_level": { + "name": "Battery level" + }, + "charge_state_battery_range": { + "name": "Battery range" + }, + "charge_state_charge_energy_added": { + "name": "Charge energy added" + }, + "charge_state_charge_rate": { + "name": "Charge rate" + }, + "charge_state_charger_actual_current": { + "name": "Charger current" + }, + "charge_state_charger_power": { + "name": "Charger power" + }, + "charge_state_charger_voltage": { + "name": "Charger voltage" + }, + "charge_state_charging_state": { + "name": "Charging", + "state": { + "charging": "Charging", + "complete": "Complete", + "disconnected": "Disconnected", + "no_power": "No power", + "starting": "Starting", + "stopped": "Stopped" + } + }, + "charge_state_conn_charge_cable": { + "name": "Charge cable" + }, + "charge_state_est_battery_range": { + "name": "Estimate battery range" + }, + "charge_state_fast_charger_type": { + "name": "Fast charger type" + }, + "charge_state_ideal_battery_range": { + "name": "Ideal battery range" + }, + "charge_state_minutes_to_full_charge": { + "name": "Time to full charge" + }, + "charge_state_usable_battery_level": { + "name": "Usable battery level" + }, + "climate_state_driver_temp_setting": { + "name": "Driver temperature setting" + }, + "climate_state_inside_temp": { + "name": "Inside temperature" + }, + "climate_state_outside_temp": { + "name": "Outside temperature" + }, + "climate_state_passenger_temp_setting": { + "name": "Passenger temperature setting" + }, + "consumer_energy_imported_from_battery": { + "name": "Consumer imported from battery" + }, + "consumer_energy_imported_from_generator": { + "name": "Consumer imported from generator" + }, + "consumer_energy_imported_from_grid": { + "name": "Consumer imported from grid" + }, + "consumer_energy_imported_from_solar": { + "name": "Consumer imported from solar" + }, + "cruise_follow_distance": { + "name": "Cruise follow distance" + }, + "cruise_set_speed": { + "name": "Cruise set speed" + }, + "current_limit_mph": { + "name": "Current speed limit" + }, + "dc_charging_energy_in": { + "name": "DC charging energy in" + }, + "dc_charging_power": { + "name": "DC charging power" + }, + "di_axle_speed_f": { + "name": "Front drive inverter axle speed" + }, + "di_axle_speed_r": { + "name": "Rear drive inverter axle speed" + }, + "di_axle_speed_rel": { + "name": "Rear left drive inverter axle speed" + }, + "di_axle_speed_rer": { + "name": "Rear right drive inverter axle speed" + }, + "di_heatsink_tf": { + "name": "Front drive inverter heatsink temperature" + }, + "di_heatsink_tr": { + "name": "Rear drive inverter heatsink temperature" + }, + "di_heatsink_trel": { + "name": "Rear left drive inverter heatsink temperature" + }, + "di_heatsink_trer": { + "name": "Rear right drive inverter heatsink temperature" + }, + "di_inverter_tf": { + "name": "Front drive inverter temperature" + }, + "di_inverter_tr": { + "name": "Rear drive inverter temperature" + }, + "di_inverter_trel": { + "name": "Rear left drive inverter temperature" + }, + "di_inverter_trer": { + "name": "Rear right drive inverter temperature" + }, + "di_motor_current_f": { + "name": "Front drive inverter motor current" + }, + "di_motor_current_r": { + "name": "Rear drive inverter motor current" + }, + "di_motor_current_rel": { + "name": "Rear left drive inverter motor current" + }, + "di_motor_current_rer": { + "name": "Rear right drive inverter motor current" + }, + "di_slave_torque_cmd": { + "name": "Secondary drive unit torque" + }, + "di_state_f": { + "name": "Front drive inverter", + "state": { + "abort": "Abort", + "enabled": "Enabled", + "fault": "Fault", + "standby": "Standby", + "unavailable": "Unavailable" + } + }, + "di_state_r": { + "name": "Rear drive inverter", + "state": { + "abort": "[%key:component::teslemetry:sensor:di_state_f:abort]", + "enabled": "Enabled", + "fault": "[%key:component::teslemetry:sensor:di_state_f:fault]", + "standby": "Standby", + "unavailable": "[%key:component::teslemetry:sensor:di_state_f:unavailable]" + } + }, + "di_state_rel": { + "name": "Rear left drive inverter", + "state": { + "abort": "[%key:component::teslemetry:sensor:di_state_f:abort]", + "enabled": "Enabled", + "fault": "[%key:component::teslemetry:sensor:di_state_f:fault]", + "standby": "Standby", + "unavailable": "[%key:component::teslemetry:sensor:di_state_f:unavailable]" + } + }, + "di_state_rer": { + "name": "Rear right drive inverter", + "state": { + "abort": "[%key:component::teslemetry:sensor:di_state_f:abort]", + "enabled": "Enabled", + "fault": "[%key:component::teslemetry:sensor:di_state_f:fault]", + "standby": "Standby", + "unavailable": "[%key:component::teslemetry:sensor:di_state_f:unavailable]" + } + }, + "di_stator_temp_f": { + "name": "Front drive unit stator temperature" + }, + "di_stator_temp_r": { + "name": "Rear drive unit stator temperature" + }, + "di_stator_temp_rel": { + "name": "Rear left drive unit stator temperature" + }, + "di_stator_temp_rer": { + "name": "Rear right drive unit stator temperature" + }, + "di_torque_actual_f": { + "name": "Front drive unit actual torque" + }, + "di_torque_actual_r": { + "name": "Rear drive unit actual torque" + }, + "di_torque_actual_rel": { + "name": "Rear left drive unit actual torque" + }, + "di_torque_actual_rer": { + "name": "Rear right drive unit actual torque" + }, + "di_torquemotor": { + "name": "Drive unit torque" + }, + "di_vbat_f": { + "name": "Front drive inverter battery voltage" + }, + "di_vbat_r": { + "name": "Rear drive inverter battery voltage" + }, + "di_vbat_rel": { + "name": "Rear left drive inverter battery voltage" + }, + "di_vbat_rer": { + "name": "Rear right drive inverter battery voltage" + }, + "drive_state_active_route_destination": { + "name": "Destination" + }, + "drive_state_active_route_energy_at_arrival": { + "name": "State of charge at arrival" + }, + "drive_state_active_route_miles_to_arrival": { + "name": "Distance to arrival" + }, + "drive_state_active_route_minutes_to_arrival": { + "name": "Time to arrival" + }, + "drive_state_active_route_traffic_minutes_delay": { + "name": "Traffic delay" + }, + "drive_state_power": { + "name": "Power" + }, + "drive_state_shift_state": { + "name": "Shift state", + "state": { + "d": "Drive", + "n": "Neutral", + "p": "Park", + "r": "Reverse" + } + }, + "drive_state_speed": { + "name": "Speed" + }, + "energy_left": { + "name": "Energy left" + }, + "energy_remaining": { + "name": "Energy remaining" + }, + "estimated_hours_to_charge_termination": { + "name": "Estimated hours to charge termination" + }, + "forward_collision_warning": { + "name": "Forward collision warning", + "state": { + "average": "Average", + "early": "Early", + "late": "Late", + "off": "Off" + } + }, + "generator_energy_exported": { + "name": "Generator exported" + }, + "generator_power": { + "name": "Generator power" + }, + "gps_heading": { + "name": "GPS heading" + }, + "grid_energy_exported_from_battery": { + "name": "Grid exported from battery" + }, + "grid_energy_exported_from_generator": { + "name": "Grid exported from generator" + }, + "grid_energy_exported_from_solar": { + "name": "Grid exported from solar" + }, + "grid_energy_imported": { + "name": "Grid imported" + }, + "grid_power": { + "name": "Grid power" + }, + "grid_services_energy_exported": { + "name": "Grid services exported" + }, + "grid_services_energy_imported": { + "name": "Grid services imported" + }, + "grid_services_power": { + "name": "Grid services power" + }, + "guest_mode_mobile_access_state": { + "name": "Guest mode mobile access", + "state": { + "aborted_bad_data_received": "Aborted bad data received", + "aborted_drive_auth_time_exceeded": "Aborted drive auth time exceeded", + "aborted_driving": "Aborted driving", + "aborted_fetch_failed": "Aborted fetch failed", + "aborted_guest_mode_off": "Aborted guest mode off", + "aborted_no_data_received": "Aborted no data received", + "aborted_using_ble_keys": "Aborted using BLE keys", + "aborted_using_remote_start": "Aborted using remote start", + "aborted_valet_mode": "Aborted valet mode", + "authenticated": "Authenticated", + "dismissed_qr_code_expired": "Dismissed QR code expired", + "init": "Init", + "not_authenticated": "Not authenticated", + "requesting_from_auth_d": "Requesting from Authd", + "requesting_from_mothership": "Requesting from mothership", + "showing_qr_code": "Showing QR code", + "succeeded_paired_new_ble_key": "Succeeded paired new BLE key", + "swiped_away": "Swiped away" + } + }, + "homelink_device_count": { + "name": "Homelink devices" + }, + "hvac_fan_speed": { + "name": "HVAC fan speed" + }, + "hvac_fan_status": { + "name": "HVAC fan status" + }, + "hvac_power_state": { + "name": "HVAC power state", + "state": { + "off": "Off", + "on": "On", + "overheat_protection": "Overheat protection", + "precondition": "Precondition" + } + }, + "island_status": { + "name": "Island status", + "state": { + "island_status_unknown": "Unknown", + "off_grid": "Off-grid", + "off_grid_intentional": "Off-grid intentional", + "off_grid_unintentional": "Off-grid unintentional", + "on_grid": "On-grid" + } + }, + "isolation_resistance": { + "name": "Isolation resistance" + }, + "lane_departure_avoidance": { + "name": "Lane departure avoidance", + "state": { + "assist": "Assist", + "off": "Off", + "warning": "Warning" + } + }, + "lateral_acceleration": { + "name": "Lateral acceleration" + }, + "lifetime_energy_used": { + "name": "Lifetime energy used" + }, + "lifetime_energy_used_drive": { + "name": "Lifetime energy used drive" + }, + "lights_turn_signal": { + "name": "Turn signal", + "state": { + "both": "Both", + "left": "Left", + "off": "Off", + "right": "Right" + } + }, + "load_power": { + "name": "Load power" + }, + "longitudinal_acceleration": { + "name": "Longitudinal acceleration" + }, + "module_temp_max": { + "name": "Module temperature maximum" + }, + "module_temp_min": { + "name": "Module temperature minimum" + }, + "pack_current": { + "name": "Pack current" + }, + "pack_voltage": { + "name": "Pack voltage" + }, + "paired_phone_key_and_key_fob_qty": { + "name": "Paired phone key and key fob quantity" + }, + "pedal_position": { + "name": "Pedal position" + }, + "percentage_charged": { + "name": "Percentage charged" + }, + "powershare_hours_left": { + "name": "Powershare hours left" + }, + "powershare_instantaneous_power_kw": { + "name": "Powershare instantaneous power" + }, + "powershare_status": { + "name": "Powershare status", + "state": { + "enabled": "Enabled", + "handshaking": "Handshaking", + "inactive": "Inactive", + "init": "Initializing", + "reconnecting": "Reconnecting", + "stopped": "Stopped" + } + }, + "powershare_stop_reason": { + "name": "Powershare stop reason", + "state": { + "authentication": "Authentication", + "fault": "Fault", + "none": "None", + "reconnecting": "Reconnecting", + "retry": "Retry", + "soc_too_low": "SOC too low", + "user": "User" + } + }, + "powershare_type": { + "name": "Powershare type", + "state": { + "home": "Home", + "load": "Load", + "none": "None" + } + }, + "rated_range": { + "name": "Rated range" + }, + "route_last_updated": { + "name": "Route last updated" + }, + "scheduled_charging_mode": { + "name": "Scheduled charging mode", + "state": { + "departure": "Departure", + "off": "Off", + "start_at": "Start at" + } + }, + "software_update_expected_duration_minutes": { + "name": "Software update expected duration" + }, + "solar_energy_exported": { + "name": "Solar exported" + }, + "solar_power": { + "name": "Solar power" + }, + "speed_limit_warning": { + "name": "Speed limit warning", + "state": { + "chime": "Chime", + "display": "Display", + "none": "None" + } + }, + "tonneau_tent_mode": { + "name": "Tonneau tent mode", + "state": { + "active": "Active", + "failed": "Failed", + "inactive": "Inactive", + "moving": "Moving" + } + }, + "total_battery_charge": { + "name": "Battery charged" + }, + "total_battery_discharge": { + "name": "Battery discharged" + }, + "total_grid_energy_exported": { + "name": "Grid exported" + }, + "total_home_usage": { + "name": "Home usage" + }, + "total_pack_energy": { + "name": "Total pack energy" + }, + "total_solar_generation": { + "name": "Solar generated" + }, + "tpms_hard_warnings": { + "name": "Tire pressure hard warnings" + }, + "tpms_soft_warnings": { + "name": "Tire pressure soft warnings" + }, + "vehicle_state_odometer": { + "name": "Odometer" + }, + "vehicle_state_tpms_pressure_fl": { + "name": "Tire pressure front left" + }, + "vehicle_state_tpms_pressure_fr": { + "name": "Tire pressure front right" + }, + "vehicle_state_tpms_pressure_rl": { + "name": "Tire pressure rear left" + }, + "vehicle_state_tpms_pressure_rr": { + "name": "Tire pressure rear right" + }, + "version": { + "name": "version" + }, + "vin": { + "name": "Vehicle", + "state": { + "disconnected": "Disconnected" + } + }, + "vpp_backup_reserve_percent": { + "name": "VPP backup reserve" + }, + "wall_connector_fault_state": { + "name": "Fault state code" + }, + "wall_connector_power": { + "name": "Power" + }, + "wall_connector_state": { + "name": "State code" + } + }, + "switch": { + "charge_state_charging_state": { + "name": "Charge" + }, + "climate_state_auto_seat_climate_left": { + "name": "Auto seat climate left" + }, + "climate_state_auto_seat_climate_right": { + "name": "Auto seat climate right" + }, + "climate_state_auto_steering_wheel_heat": { + "name": "Auto steering wheel heater" + }, + "climate_state_defrost_mode": { + "name": "Defrost" + }, + "components_disallow_charge_from_grid_with_solar_installed": { + "name": "Allow charging from grid" + }, + "user_settings_storm_mode_enabled": { + "name": "Storm watch" + }, + "vehicle_state_sentry_mode": { + "name": "Sentry mode" + }, + "vehicle_state_valet_mode": { + "name": "Valet mode" + } + }, + "update": { + "vehicle_state_software_update_status": { + "name": "Update" + } + } + }, + "exceptions": { + "command_error": { + "message": "Command returned error: {error}" + }, + "command_exception": { + "message": "Command returned exception: {message}" + }, + "command_no_result": { + "message": "Command had no result" + }, + "command_reason": { + "message": "Command was rejected: {reason}" + }, + "invalid_cop_temp": { + "message": "Cabin overheat protection does not support that temperature" + }, + "invalid_device": { + "message": "Invalid device ID: {device_id}" + }, + "missing_scope": { + "message": "Missing required scope: {scope}" + }, + "no_cable": { + "message": "Charge cable will lock automatically when connected" + }, + "no_config_entry_for_device": { + "message": "No config entry for device ID: {device_id}" + }, + "no_energy_site_data_for_device": { + "message": "No energy site data for device ID: {device_id}" + }, + "no_vehicle_data_for_device": { + "message": "No vehicle data for device ID: {device_id}" + }, + "set_scheduled_charging_time": { + "message": "Time required to complete the operation" + }, + "set_scheduled_departure_off_peak": { + "message": "To enable scheduled departure, 'End off-peak time' is required." + }, + "set_scheduled_departure_preconditioning": { + "message": "Departure time required to enable preconditioning" + }, + "wake_up_failed": { + "message": "Failed to wake up vehicle: {message}" + }, + "wake_up_timeout": { + "message": "Timed out trying to wake up vehicle" + } + }, + "services": { + "navigation_gps_request": { + "description": "Sets vehicle navigation to the provided latitude/longitude coordinates.", + "fields": { + "device_id": { + "description": "Vehicle to share to.", + "name": "Vehicle" + }, + "gps": { + "description": "Location to navigate to.", + "name": "Location" + }, + "order": { + "description": "Order for this destination if specifying multiple destinations.", + "name": "Order" + } + }, + "name": "Navigate to coordinates" + }, + "set_scheduled_charging": { + "description": "Sets a time at which charging should be started.", + "fields": { + "device_id": { + "description": "Vehicle to schedule.", + "name": "Vehicle" + }, + "enable": { + "description": "Enable or disable scheduled charging.", + "name": "Enable" + }, + "time": { + "description": "Time to start charging.", + "name": "Time" + } + }, + "name": "Set scheduled charging" + }, + "set_scheduled_departure": { + "description": "Sets the departure time for a vehicle to schedule charging and preconditioning.", + "fields": { + "departure_time": { + "description": "Time to be preconditioned by.", + "name": "Departure time" + }, + "device_id": { + "description": "Vehicle to schedule.", + "name": "Vehicle" + }, + "enable": { + "description": "Enable or disable scheduled departure.", + "name": "Enable" + }, + "end_off_peak_time": { + "description": "Time to complete charging by.", + "name": "End off-peak time" + }, + "off_peak_charging_enabled": { + "description": "Enable off-peak charging.", + "name": "Off-peak charging enabled" + }, + "off_peak_charging_weekdays_only": { + "description": "Enable off-peak charging on weekdays only.", + "name": "Off-peak charging weekdays only" + }, + "preconditioning_enabled": { + "description": "Enable preconditioning.", + "name": "Preconditioning enabled" + }, + "preconditioning_weekdays_only": { + "description": "Enable preconditioning on weekdays only.", + "name": "Preconditioning weekdays only" + } + }, + "name": "Set scheduled departure" + }, + "speed_limit": { + "description": "Activates the speed limit of a vehicle.", + "fields": { + "device_id": { + "description": "Vehicle to limit.", + "name": "Vehicle" + }, + "enable": { + "description": "Enable or disable speed limit.", + "name": "Enable" + }, + "pin": { + "description": "4 digit PIN.", + "name": "PIN" + } + }, + "name": "Set speed limit" + }, + "time_of_use": { + "description": "Updates the time of use settings for an energy site.", + "fields": { + "device_id": { + "description": "Energy Site to configure.", + "name": "Energy Site" + }, + "tou_settings": { + "description": "See https://developer.tesla.com/docs/fleet-api#time_of_use_settings for details.", + "name": "Settings" + } + }, + "name": "Time of use settings" + }, + "valet_mode": { + "description": "Activates the valet mode of a vehicle.", + "fields": { + "device_id": { + "description": "Vehicle to limit.", + "name": "Vehicle" + }, + "enable": { + "description": "Enable or disable valet mode.", + "name": "Enable" + }, + "pin": { + "description": "4 digit PIN.", + "name": "PIN" + } + }, + "name": "Set valet mode" + } + } +} \ No newline at end of file diff --git a/release.sh b/release.sh new file mode 100755 index 00000000000..8a98761db8c --- /dev/null +++ b/release.sh @@ -0,0 +1,51 @@ +# Get everything up to date +git checkout main +git fetch upstream dev +git rebase upstream/dev +git push --force-with-lease + +# Ask for version +echo "Last version:" +gh release ls --repo teslemetry/hass-teslemetry --limit 1 +echo "New version:" +read VERSION + +git branch -D release-$VERSION +git checkout -b release-$VERSION + +rm release_notes.txt + +for PR_NUMBER in $(gh pr list --repo home-assistant/core --author Bre77 --state open --json number | jq -r '.[].number'); do + PR_TITLE=$(gh pr view $PR_NUMBER --repo home-assistant/core --json title | jq -r '.title') + echo "Applying patch from PR #$PR_NUMBER: $PR_TITLE" + gh pr diff $PR_NUMBER --patch --repo home-assistant/core | git apply -3 + git mergetool + git commit -am "#$PR_NUMBER: $PR_TITLE" --no-verify + echo "[#$PR_NUMBER](https://github.com/home-assistant/core/pull/$PR_NUMBER): $PR_TITLE" >> release_notes.txt +done + +yq -i -o json ".version=\"$VERSION\"" "homeassistant/components/teslemetry/manifest.json" +echo "" >> release_notes.txt +echo "**Full Changelog**: https://github.com/Teslemetry/hass-teslemetry/commits/v$VERSION" >> release_notes.txt + +git commit -am "v$VERSION" --no-verify + +script/setup +uv pip install -r requirements_test_all.txt +pytest tests/components/teslemetry + +read -p "Press Enter to release..." + +git tag -a v$VERSION -m "Release $VERSION" +git push origin v$VERSION +cd homeassistant/components/teslemetry +rm -r __pycache__ +rm *.orig +zip -r ../../../teslemetry.zip * +cd ../../.. +gh release create v$VERSION -F release_notes.txt --repo Teslemetry/hass-teslemetry -t "Beta v$VERSION" +gh release upload v$VERSION teslemetry.zip --repo Teslemetry/hass-teslemetry +rm teslemetry.zip +git push +git checkout main +git restore .