Skip to content

Fix for Home Assistant Change - object_id depreciated for default_entity_id - #12

Open
Roving-Ronin wants to merge 1 commit into
cabberley:mainfrom
Roving-Ronin:patch-object-id
Open

Fix for Home Assistant Change - object_id depreciated for default_entity_id#12
Roving-Ronin wants to merge 1 commit into
cabberley:mainfrom
Roving-Ronin:patch-object-id

Conversation

@Roving-Ronin

@Roving-Ronin Roving-Ronin commented Oct 5, 2025

Copy link
Copy Markdown

Update object_id to default_entity_id in line with changes to Home Assistant, that now sees object_id depreciated.

See: home-assistant/core#151775

Summary by Sourcery

Bug Fixes:

  • Replace deprecated obj_id fields with default_entity_id in all sensor discovery message dictionaries

Update object_id to default_entity_id in line with changes to Home Assistant, that now sees object_id depreciated.
@sourcery-ai

sourcery-ai Bot commented Oct 5, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the MQTT discovery payload generation to align with Home Assistant’s deprecation of the "obj_id" field by replacing it with "default_entity_id" across all relevant message constructors.

Entity relationship diagram for sensor discovery message payload update

erDiagram
    SENSOR_DICT {
        string name
        string unique_id
        string default_entity_id
        string state_topic
        string json_attributes_topic
        string p
        string value_template
    }
Loading

Class diagram for updated sensor discovery payload structure

classDiagram
class sensorDict {
  +name: string
  +unique_id: string
  +default_entity_id: string
  +state_topic: string
  +json_attributes_topic: string
  +p: string
  +value_template: string
}
Loading

File-Level Changes

Change Details Files
Rename "obj_id" to "default_entity_id" in MQTT discovery payloads
  • Update key in base amberDiscoveryMessage sensor dictionaries
  • Apply replacement in all amberForecast*DiscoveryMessage functions (5min, 30min, 288, user)
  • Apply replacement in aemoDiscoveryMessage sensor dictionaries
mqttmessages.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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