Skip to content

Commit

Permalink
Merge pull request #15 from mbta/cm/new-recon-alert-config-value
Browse files Browse the repository at this point in the history
tweak: Add new ReconstructedAlert widget config struct
  • Loading branch information
cmaddox5 authored Mar 4, 2024
2 parents 9974047 + 70fff4c commit f6e96ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/config/v2/pre_fare.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ defmodule ScreensConfig.V2.PreFare do
ElevatorStatus,
EvergreenContentItem,
FullLineMap,
ReconstructedAlert,
ShuttleBusInfo
}

alias ScreensConfig.V2.Header.CurrentStopId

@type t :: %__MODULE__{
header: CurrentStopId.t(),
reconstructed_alert_widget: CurrentStopId.t(),
reconstructed_alert_widget: ReconstructedAlert.t(),
elevator_status: ElevatorStatus.t(),
full_line_map: list(FullLineMap.t()),
evergreen_content: list(EvergreenContentItem.t()),
Expand Down Expand Up @@ -52,7 +53,7 @@ defmodule ScreensConfig.V2.PreFare do
full_line_map: {:list, FullLineMap},
evergreen_content: {:list, EvergreenContentItem},
blue_bikes: BlueBikes,
reconstructed_alert_widget: CurrentStopId,
reconstructed_alert_widget: ReconstructedAlert,
content_summary: ContentSummary,
audio: Audio,
cr_departures: CRDepartures,
Expand Down
20 changes: 20 additions & 0 deletions lib/config/v2/reconstructed_alert.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
defmodule ScreensConfig.V2.ReconstructedAlert do
@moduledoc false

alias ScreensConfig.V2.Header.CurrentStopId

@type t :: %__MODULE__{
parent_station_id: CurrentStopId.t(),
pair_takeover_with_cr_widget: boolean()
}

@enforce_keys [:parent_station_id]
defstruct parent_station_id: nil,
pair_takeover_with_cr_widget: false

use ScreensConfig.Struct, children: [parent_station_id: CurrentStopId]

defp value_from_json(_, value), do: value

defp value_to_json(_, value), do: value
end

0 comments on commit f6e96ba

Please sign in to comment.