Skip to content

Add 16 new device classes for specific sensor types and remote controls, update socket class description#587

Open
Copilot wants to merge 4 commits intodevelopfrom
copilot/fix-586
Open

Add 16 new device classes for specific sensor types and remote controls, update socket class description#587
Copilot wants to merge 4 commits intodevelopfrom
copilot/fix-586

Conversation

Copy link

Copilot AI commented Sep 5, 2025

This PR adds 16 new device classes to provide more granular categorization for sensors and remote controls, making it easier for developers to choose the appropriate device class for their specific use cases.

New Sensor Classes Added

Contact & Motion Sensors:

  • sensor_contact - For contact sensors that detect open/close states (door/window sensors)
  • sensor_occupancy - For occupancy and presence sensors

Environmental Sensors:

  • sensor_temperature - For temperature sensors
  • sensor_humidity - For humidity sensors
  • sensor_pressure - For atmospheric pressure sensors
  • sensor_illuminance - For light/brightness sensors
  • sensor_air_quality - For air quality sensors (VOCs, CO2, pollutants)
  • sensor_rain - For rain and precipitation sensors

Utility Monitoring Sensors:

  • sensor_water_flow - For water flow rate sensors
  • sensor_gas_flow - For gas flow rate sensors
  • sensor_electricity - For electrical parameter sensors (voltage, current, power)

Safety & Leak Detection Sensors:

  • sensor_gas_leak - For gas leak detection
  • sensor_water_leak - For water leak detection
  • sensor_water_freeze - For freeze protection sensors

New Remote Control Classes

  • remote_switch - For remote switches and wall switches that control other devices wirelessly
  • remote_portable - For portable remote controls like handheld remotes, keyfobs, and mobile devices

Updated Existing Classes

The existing sensor class description has been updated to clarify that it should be used when a device is composed of multiple sensors (e.g., humidity + temperature), while specific sensor types should use the new dedicated sensor_* classes.

The socket class description has been updated to:

Use this device class for sockets (built-in or plug-in socket switches) or fixed switches, e.g. those connected to a light.

This removes the previous mention of the choose_slave pair template and clarifies the class can be used for fixed switches as well.

Implementation Details

  • All new device classes include complete translations for all 13 supported languages
  • Device class definitions follow the established pattern with meaningful titles and descriptions
  • Generated locale files are excluded from this PR as they are automatically generated
  • All existing tests continue to pass
  • New device classes are properly loaded and accessible through the existing API

This change provides better semantic categorization while maintaining full backward compatibility.

Fixes #586.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: WeeJeWel <319873+WeeJeWel@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new device classes Add 16 new device classes for specific sensor types and remote controls Sep 5, 2025
Copilot AI requested a review from WeeJeWel September 5, 2025 12:11
@WeeJeWel WeeJeWel requested a review from nozols September 5, 2025 12:12
@WeeJeWel WeeJeWel assigned nozols and unassigned WeeJeWel Sep 5, 2025
@WeeJeWel WeeJeWel marked this pull request as ready for review September 5, 2025 12:12
@WeeJeWel
Copy link
Contributor

WeeJeWel commented Sep 5, 2025

@copilot Please also change the socket class description to:

Use this device class for sockets (built-in or plug-in socket switches) or fixed switches, e.g. those connected to a light.

(drop the choose_slave mention).

Co-authored-by: WeeJeWel <319873+WeeJeWel@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 5, 2025

@copilot Please also change the socket class description to:

...

Updated the socket class description to remove the choose_slave mention and replaced it with the new description as requested. The change includes translations for all 13 supported languages and has been applied in commit 114e080.

Copilot AI changed the title Add 16 new device classes for specific sensor types and remote controls Add 16 new device classes for specific sensor types and remote controls, update socket class description Sep 5, 2025
Copilot AI requested a review from WeeJeWel September 5, 2025 14:36
@WeeJeWel
Copy link
Contributor

WeeJeWel commented Sep 5, 2025

@copilot Remove all changes to generated_locales.

Co-authored-by: WeeJeWel <319873+WeeJeWel@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 5, 2025

@copilot Remove all changes to generated_locales.

Removed all changes to generated_locales as requested. The device class definitions remain intact while the generated locale files have been reverted to their original state. Commit bcb8fc4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add new device classes

3 participants