fix: add missing handle_info for state_sensors_updated in GraphLive.Show
Adds handler to reload graph data when state sensors are updated via PubSub, preventing GenServer crash when viewing graph page during sensor updates.
This commit is contained in:
parent
0d6caa897f
commit
912cb8d280
1 changed files with 6 additions and 0 deletions
|
|
@ -602,6 +602,12 @@ defmodule ToweropsWeb.GraphLive.Show do
|
|||
{:noreply, assign(socket, :device, device)}
|
||||
end
|
||||
|
||||
# Handle sensor updates from PubSub
|
||||
@impl true
|
||||
def handle_info({:state_sensors_updated, _device_id}, socket) do
|
||||
{:noreply, load_graph_data(socket)}
|
||||
end
|
||||
|
||||
# Handle live poll event
|
||||
@impl true
|
||||
def handle_info(:live_poll, socket) do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue