Skip to content

Commit

Permalink
Revert binary_sensor part of home-assistant#103210 (home-assistant#10…
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus authored Nov 6, 2023
1 parent c17def2 commit 8f684ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
10 changes: 2 additions & 8 deletions homeassistant/components/mqtt/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
MqttAvailability,
MqttEntity,
async_setup_entity_entry_helper,
validate_sensor_entity_category,
write_state_on_attr_change,
)
from .models import MqttValueTemplate, ReceiveMessage
Expand All @@ -56,7 +55,7 @@
DEFAULT_FORCE_UPDATE = False
CONF_EXPIRE_AFTER = "expire_after"

_PLATFORM_SCHEMA_BASE = MQTT_RO_SCHEMA.extend(
PLATFORM_SCHEMA_MODERN = MQTT_RO_SCHEMA.extend(
{
vol.Optional(CONF_DEVICE_CLASS): vol.Any(DEVICE_CLASSES_SCHEMA, None),
vol.Optional(CONF_EXPIRE_AFTER): cv.positive_int,
Expand All @@ -68,12 +67,7 @@
}
).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)

DISCOVERY_SCHEMA = vol.All(
validate_sensor_entity_category,
_PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA),
)

PLATFORM_SCHEMA_MODERN = vol.All(validate_sensor_entity_category, _PLATFORM_SCHEMA_BASE)
DISCOVERY_SCHEMA = PLATFORM_SCHEMA_MODERN.extend({}, extra=vol.REMOVE_EXTRA)


async def async_setup_entry(
Expand Down
9 changes: 0 additions & 9 deletions tests/components/mqtt/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2163,15 +2163,6 @@ async def test_setup_manual_mqtt_with_invalid_config(
}
}
},
{
mqtt.DOMAIN: {
"binary_sensor": {
"name": "test",
"state_topic": "test-topic",
"entity_category": "config",
}
}
},
],
)
@patch(
Expand Down

0 comments on commit 8f684ab

Please sign in to comment.