Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
e54031e3
Unverified
Commit
e54031e3
authored
5 months ago
by
Jan Bouwhuis
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improve mqtt sensor options validion logging (#127631)
* Improve mqtt sensor options validion logging * Fix test
parent
24fbc366
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/mqtt/sensor.py
+1
-1
1 addition, 1 deletion
homeassistant/components/mqtt/sensor.py
tests/components/mqtt/test_sensor.py
+1
-1
1 addition, 1 deletion
tests/components/mqtt/test_sensor.py
with
2 additions
and
2 deletions
homeassistant/components/mqtt/sensor.py
+
1
−
1
View file @
e54031e3
...
...
@@ -100,7 +100,7 @@ def validate_sensor_state_and_device_class_config(config: ConfigType) -> ConfigT
if
(
device_class
:
=
config
.
get
(
CONF_DEVICE_CLASS
))
!=
SensorDeviceClass
.
ENUM
:
raise
vol
.
Invalid
(
f
"
The option `
{
CONF_OPTIONS
}
`
can only
be used
"
f
"
The option `
{
CONF_OPTIONS
}
`
must
be used
"
f
"
together with device class `
{
SensorDeviceClass
.
ENUM
}
`,
"
f
"
got `
{
CONF_DEVICE_CLASS
}
`
'
{
device_class
}
'"
)
...
...
This diff is collapsed.
Click to expand it.
tests/components/mqtt/test_sensor.py
+
1
−
1
View file @
e54031e3
...
...
@@ -956,7 +956,7 @@ async def test_invalid_state_class(
}
}
},
"
The option `options`
can only
be used together with
"
"
The option `options`
must
be used together with
"
"
device class `enum`, got `device_class`
'
gas
'"
,
),
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment