mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Avoid references to websocket_api.const in core and other components (#119285)
This commit is contained in:
@@ -1648,9 +1648,7 @@ class PipelineStorageCollectionWebsocket(
|
||||
try:
|
||||
await super().ws_delete_item(hass, connection, msg)
|
||||
except PipelinePreferred as exc:
|
||||
connection.send_error(
|
||||
msg["id"], websocket_api.const.ERR_NOT_ALLOWED, str(exc)
|
||||
)
|
||||
connection.send_error(msg["id"], websocket_api.ERR_NOT_ALLOWED, str(exc))
|
||||
|
||||
@callback
|
||||
def ws_get_item(
|
||||
@@ -1664,7 +1662,7 @@ class PipelineStorageCollectionWebsocket(
|
||||
if item_id not in self.storage_collection.data:
|
||||
connection.send_error(
|
||||
msg["id"],
|
||||
websocket_api.const.ERR_NOT_FOUND,
|
||||
websocket_api.ERR_NOT_FOUND,
|
||||
f"Unable to find {self.item_id_key} {item_id}",
|
||||
)
|
||||
return
|
||||
@@ -1695,7 +1693,7 @@ class PipelineStorageCollectionWebsocket(
|
||||
self.storage_collection.async_set_preferred_item(msg[self.item_id_key])
|
||||
except ItemNotFound:
|
||||
connection.send_error(
|
||||
msg["id"], websocket_api.const.ERR_NOT_FOUND, "unknown item"
|
||||
msg["id"], websocket_api.ERR_NOT_FOUND, "unknown item"
|
||||
)
|
||||
return
|
||||
connection.send_result(msg["id"])
|
||||
|
||||
Reference in New Issue
Block a user