diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 46cc605..c8a4d64 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,8 +1,9 @@ # Release Notes -## 1.4.5 - 2019-06-28 +## 1.4.6 - 2019-06-28 * Update deps * Use --self-contained for Firmware +* Hook into view ## 1.3.1 - 2019-03-22 * Show light diff --git a/src/Client/ReleaseNotes.fs b/src/Client/ReleaseNotes.fs index ea216ac..1370c6b 100644 --- a/src/Client/ReleaseNotes.fs +++ b/src/Client/ReleaseNotes.fs @@ -1,15 +1,16 @@ module internal ReleaseNotes -let Version = "1.4.5" +let Version = "1.4.6" let IsPrerelease = false let Notes = """ # Release Notes -## 1.4.5 - 2019-06-28 +## 1.4.6 - 2019-06-28 * Update deps * Use --self-contained for Firmware +* Hook into view ## 1.3.1 - 2019-03-22 * Show light diff --git a/src/PiServer/Elmish.Audio.fs b/src/PiServer/Elmish.Audio.fs index b9ef2a1..86be690 100644 --- a/src/PiServer/Elmish.Audio.fs +++ b/src/PiServer/Elmish.Audio.fs @@ -74,8 +74,8 @@ module Program = with _ -> () } - let mapSetState setState model dispatch = - let (v:Audio) = Program.view program model dispatch + let mapView view model dispatch = + let (v:Audio) = view model dispatch match lastView with | Some r when r = v -> () | Some r -> @@ -96,7 +96,7 @@ module Program = | _ -> () lastView <- Some v - setState model dispatch + v program - |> Program.map id id id mapSetState id + |> Program.map id id mapView id id diff --git a/src/PiServer/PiServer.fs b/src/PiServer/PiServer.fs index 51f4b2e..c503b03 100644 --- a/src/PiServer/PiServer.fs +++ b/src/PiServer/PiServer.fs @@ -24,7 +24,7 @@ let runIn (timeSpan:TimeSpan) successMsg errorMsg = do! Task.Delay (int timeSpan.TotalMilliseconds) return () } - Cmd.ofTask t () (fun _ -> successMsg) errorMsg + Cmd.OfTask.either t () (fun _ -> successMsg) errorMsg let log = @@ -153,14 +153,14 @@ let update (msg:Msg) (model:Model) = match msg with | VolumeUp -> let vol = min 1. (model.Volume + 0.1) - { model with Volume = vol }, Cmd.ofFunc setVolumeScript vol Noop Err + { model with Volume = vol }, Cmd.OfFunc.either setVolumeScript vol Noop Err | VolumeDown -> let vol = max 0. (model.Volume - 0.1) - { model with Volume = vol }, Cmd.ofFunc setVolumeScript vol Noop Err + { model with Volume = vol }, Cmd.OfFunc.either setVolumeScript vol Noop Err | NewRFID rfid -> - { model with RFID = Some rfid }, Cmd.ofTask nextFile (model,rfid) NewTag Err + { model with RFID = Some rfid }, Cmd.OfTask.either nextFile (model,rfid) NewTag Err | RFIDRemoved -> { model with RFID = None }, Cmd.ofMsg (FinishPlaylist()) @@ -190,14 +190,14 @@ let update (msg:Msg) (model:Model) = | NextMediaFile -> match model.RFID with | Some rfid -> - model, Cmd.ofTask nextFile (model,rfid) NewTag Err + model, Cmd.OfTask.either nextFile (model,rfid) NewTag Err | None -> model, Cmd.none | PreviousMediaFile -> match model.RFID with | Some rfid -> - model, Cmd.ofTask previousFile (model,rfid) NewTag Err + model, Cmd.OfTask.either previousFile (model,rfid) NewTag Err | None -> model, Cmd.none @@ -205,13 +205,13 @@ let update (msg:Msg) (model:Model) = { model with Playing = None }, Cmd.none | CheckFirmware -> - model, Cmd.ofTask FirmwareUpdate.checkFirmware (log,model.TagServer) FirmwareUpToDate Err + model, Cmd.OfTask.either FirmwareUpdate.checkFirmware (log,model.TagServer) FirmwareUpToDate Err | Noop _ -> model, Cmd.none | DiscoverStartup -> - model, Cmd.ofTask getStartupAction model ExecuteAction Err + model, Cmd.OfTask.either getStartupAction model ExecuteAction Err | FirmwareUpToDate _ -> log.InfoFormat("Firmware {0} is uptodate.", ReleaseNotes.Version)