Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depreciation warning of entity service with a non entity service schema #62

Open
mamrai1 opened this issue Oct 30, 2024 · 2 comments
Open

Comments

@mamrai1
Copy link
Contributor

mamrai1 commented Oct 30, 2024

2024-10-30 23:17:35.071 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hysen' registers an entity service with a non entity service schema which will stop working in HA Core 2025.9 at custom_components/hysen/climate.py, line 527: hass.data[DOMAIN].async_register_entity_service(, please create a bug report at https://github.com/mairas/hysen/issues
2024-10-30 23:17:35.074 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hysen' registers an entity service with a non entity service schema which will stop working in HA Core 2025.9 at custom_components/hysen/climate.py, line 532: hass.data[DOMAIN].async_register_entity_service(, please create a bug report at https://github.com/mairas/hysen/issues
2024-10-30 23:17:35.076 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hysen' registers an entity service with a non entity service schema which will stop working in HA Core 2025.9 at custom_components/hysen/climate.py, line 537: hass.data[DOMAIN].async_register_entity_service(, please create a bug report at https://github.com/mairas/hysen/issues
2024-10-30 23:17:35.081 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hysen' registers an entity service with a non entity service schema which will stop working in HA Core 2025.9 at custom_components/hysen/climate.py, line 542: hass.data[DOMAIN].async_register_entity_service(, please create a bug report at https://github.com/mairas/hysen/issues

@Joao-Sousa-71
Copy link

Joao-Sousa-71 commented Oct 30, 2024

I've got the same I and believe that I was able to fix it.
This is related with this change:

https://developers.home-assistant.io/blog/2024/08/27/entity-service-schema-validation/
https://developers.home-assistant.io/docs/dev_101_services/#entity-service-actions

Filé climate.py, Line 87, where it is:

SET_WIFI_SCHEMA = vol.Schema({
    vol.Optional(ATTR_ENTITY_ID,default="all"): cv.comp_entity_ids,
    vol.Required(CONF_WIFI_SSID): cv.string,
    vol.Required(CONF_WIFI_PASSWORD): cv.string,
    vol.Required(CONF_WIFI_SECTYPE): vol.Range(min=0, max=4),
    vol.Optional(CONF_WIFI_TIMEOUT,default=DEFAULT_TIMEOUT): vol.Range(min=0, max=99),
})

change to:

SET_WIFI_SCHEMA = {
    vol.Optional(ATTR_ENTITY_ID,default="all"): cv.comp_entity_ids,
    vol.Required(CONF_WIFI_SSID): cv.string,
    vol.Required(CONF_WIFI_PASSWORD): cv.string,
    vol.Required(CONF_WIFI_SECTYPE): vol.Range(min=0, max=4),
    vol.Optional(CONF_WIFI_TIMEOUT,default=DEFAULT_TIMEOUT): vol.Range(min=0, max=99),
}

Line 122, change this:

SET_ADVANCED_SCHEMA = vol.Schema({
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Optional(CONFIG_ADVANCED_LOOPMODE,default=DEFAULT_LOOPMODE): vol.Range(min=0, max=2),
    vol.Optional(CONFIG_ADVANCED_SENSORMODE,default=DEFAULT_SENSORMODE): vol.Range(min=0, max=2),
    vol.Optional(CONFIG_ADVANCED_MINTEMP,default=DEFAULT_MINTEMP): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_MAXTEMP,default=DEFAULT_MAXTEMP): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_ROOMTEMPOFFSET,default=DEFAULT_ROOMTEMPOFFSET): vol.Coerce(float),
    vol.Optional(CONFIG_ADVANCED_ANTIFREEZE,default=DEFAULT_ANTIFREEZE): vol.Range(min=0, max=1),
    vol.Optional(CONFIG_ADVANCED_POWERONMEM,default=DEFAULT_POWERONMEM): vol.Range(min=0, max=1),
    vol.Optional(CONFIG_ADVANCED_EXTERNALSENSORTEMPRANGE,default=DEFAULT_EXTERNALSENSORTEMPRANGE): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_DEADZONESENSORTEMPRANGE,default=DEFAULT_DEADZONESENSORTEMPRANGE): vol.Range(min=1, max=99),
})

to:

SET_ADVANCED_SCHEMA = {
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Optional(CONFIG_ADVANCED_LOOPMODE,default=DEFAULT_LOOPMODE): vol.Range(min=0, max=2),
    vol.Optional(CONFIG_ADVANCED_SENSORMODE,default=DEFAULT_SENSORMODE): vol.Range(min=0, max=2),
    vol.Optional(CONFIG_ADVANCED_MINTEMP,default=DEFAULT_MINTEMP): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_MAXTEMP,default=DEFAULT_MAXTEMP): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_ROOMTEMPOFFSET,default=DEFAULT_ROOMTEMPOFFSET): vol.Coerce(float),
    vol.Optional(CONFIG_ADVANCED_ANTIFREEZE,default=DEFAULT_ANTIFREEZE): vol.Range(min=0, max=1),
    vol.Optional(CONFIG_ADVANCED_POWERONMEM,default=DEFAULT_POWERONMEM): vol.Range(min=0, max=1),
    vol.Optional(CONFIG_ADVANCED_EXTERNALSENSORTEMPRANGE,default=DEFAULT_EXTERNALSENSORTEMPRANGE): vol.Range(min=5, max=99),
    vol.Optional(CONFIG_ADVANCED_DEADZONESENSORTEMPRANGE,default=DEFAULT_DEADZONESENSORTEMPRANGE): vol.Range(min=1, max=99),
}

then on line 138, where:

SET_REMOTELOCK_SCHEMA = vol.Schema({
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Required(CONFIG_REMOTELOCK): vol.Range(min=0, max=1),
})

change to:

SET_REMOTELOCK_SCHEMA = {
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Required(CONFIG_REMOTELOCK): vol.Range(min=0, max=1),
}

finally on line 161, change this:

SET_TIME_SCHEDULE_SCHEMA = vol.Schema({
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Required(CONFIG_WEEK_PERIOD1_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD1_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD2_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD2_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD3_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD3_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD4_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD4_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD5_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD5_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD6_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD6_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEKEND_PERIOD1_START): cv.time,
    vol.Required(CONFIG_WEEKEND_PERIOD1_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEKEND_PERIOD2_START): cv.time,
    vol.Required(CONFIG_WEEKEND_PERIOD2_TEMP): vol.Coerce(float),
})

to this:

SET_TIME_SCHEDULE_SCHEMA = {
    vol.Required(ATTR_ENTITY_ID): cv.comp_entity_ids,
    vol.Required(CONFIG_WEEK_PERIOD1_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD1_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD2_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD2_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD3_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD3_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD4_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD4_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD5_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD5_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEK_PERIOD6_START): cv.time,
    vol.Required(CONFIG_WEEK_PERIOD6_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEKEND_PERIOD1_START): cv.time,
    vol.Required(CONFIG_WEEKEND_PERIOD1_TEMP): vol.Coerce(float),
    vol.Required(CONFIG_WEEKEND_PERIOD2_START): cv.time,
    vol.Required(CONFIG_WEEKEND_PERIOD2_TEMP): vol.Coerce(float),
}

That't is.
Please try it and test.

@mamrai1
Copy link
Contributor Author

mamrai1 commented Oct 31, 2024

Works! Thanks! I will make a pr

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

No branches or pull requests

2 participants