Remove obsolete yaml check in SQL (#98950)

* Remove unique id check from SQL

* Remove unique id check from SQL
This commit is contained in:
Joost Lekkerkerker 2023-08-24 12:35:11 +02:00 committed by GitHub
parent b69e8fda77
commit 87dd18cc2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,13 +321,12 @@ class SQLSensor(ManualTriggerSensorEntity):
self._attr_extra_state_attributes = {} self._attr_extra_state_attributes = {}
self._use_database_executor = use_database_executor self._use_database_executor = use_database_executor
self._lambda_stmt = _generate_lambda_stmt(query) self._lambda_stmt = _generate_lambda_stmt(query)
if not yaml: if not yaml and (unique_id := trigger_entity_config.get(CONF_UNIQUE_ID)):
self._attr_name = None self._attr_name = None
self._attr_has_entity_name = True self._attr_has_entity_name = True
if not yaml and trigger_entity_config.get(CONF_UNIQUE_ID):
self._attr_device_info = DeviceInfo( self._attr_device_info = DeviceInfo(
entry_type=DeviceEntryType.SERVICE, entry_type=DeviceEntryType.SERVICE,
identifiers={(DOMAIN, trigger_entity_config[CONF_UNIQUE_ID])}, identifiers={(DOMAIN, unique_id)},
manufacturer="SQL", manufacturer="SQL",
name=self.name, name=self.name,
) )