Skip to content

[Deprecation Warning] localtuya uses deprecated hass.helpers.service - will break in Home Assistant Core 2026.1 #1949

Open
@LeonardSEO

Description

@LeonardSEO

Issue Summary

While running Home Assistant Core 2025.3.3 on Home Assistant OS 14.2 (Raspberry Pi 5), I encountered the following deprecation warning in the system logs regarding localtuya:

WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'localtuya' accesses hass.helpers.service, which should not be used. This will stop working in Home Assistant 2025.5, please create a bug report or fix.

Additionally, there are multiple warnings about deprecated constants used by localtuya that will be removed in Home Assistant Core 2026.1, causing inevitable breaking changes if not addressed.

Details

localtuya is currently accessing:

hass.helpers.service.async_register_admin_service()

This is explicitly flagged by Home Assistant core developers for removal.

Other deprecated constants used (examples from logs):

STATE_CLEANING, STATE_DOCKED, STATE_ERROR, STATE_IDLE, STATE_PAUSED, STATE_RETURNING

These will also be removed in Home Assistant Core 2026.1.


System Information

  • Home Assistant OS: 14.2
  • Home Assistant Core: 2025.3.3
  • Device: Raspberry Pi 5
  • localtuya Version: Latest from the master branch (March 2025)

Request

Could you please:

  • Refactor localtuya to stop using hass.helpers.service.async_register_admin_service()
  • Replace all deprecated constants flagged for removal in Core 2026.1
  • Ensure compatibility with upcoming Home Assistant versions

I am available to help test any potential fixes.


Full Log Reference Example

2025-03-18 16:31:06.342 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'localtuya' accesses hass.helpers.service, which should not be used. This will stop working in Home Assistant 2025.5, please create a bug report or fix.
...
2025-03-18 16:31:02.435 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_CLEANING was used from localtuya, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.CLEANING instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions