Commit graph

31 commits

Author SHA1 Message Date
52ec6dc025 Fix Docker build
The solution file includes the test project, but the test project isn't
copied into the first stage of the Dockerfile.
2026-01-04 20:23:18 +01:00
4e6fc6645c
Merge pull request #2 from svenvanheugten/add-tests
Add tests
2026-01-04 12:13:16 +01:00
f6fdbddafd
Merge pull request #1 from svenvanheugten/introduce-state
Introduce the ability to remember state
2026-01-04 12:11:42 +01:00
48aaabde3b Add tests for colors 2026-01-04 12:10:07 +01:00
7125fee28e Parse color commands in FakeHome 2026-01-04 12:10:07 +01:00
6baf725765 Put Arbitraries on the entire test class 2026-01-04 12:10:07 +01:00
c7c5de9e21 State -> NightLightStateMachine 2026-01-04 12:10:06 +01:00
285874777a Get rid of NightLightStateMachine in the tests 2026-01-04 12:09:09 +01:00
bd550bfcd9 Encapsulate State to make it impossible to read
This was NightLightStateMachine's purpose, but it fits equally well
in the actual production code.
2026-01-04 12:09:07 +01:00
83b716a509 Reorganize types to prepare for unit testing 2026-01-04 12:08:10 +01:00
a741938f89 Stop propagating parse errors throughout the tests 2026-01-04 12:08:10 +01:00
5219abfb4b Fix incorrect namespaces 2026-01-04 12:08:10 +01:00
109ebde64a Write the first test 2026-01-04 12:08:10 +01:00
7ea6e49001 Introduce decodeMqttApplicationMessage 2026-01-04 12:08:10 +01:00
fc069edf31 Implement FakeHome 2026-01-04 12:08:10 +01:00
27c6646237 Put a full Message in ReceivedZigbeeEvent
We'll need the topic later.
2026-01-04 12:08:10 +01:00
10e26a4866 Turn Message into a record type 2026-01-04 12:08:10 +01:00
ab6e123efc ZigbeeCommand -> Message
There isn't really anything specifically Zigbee about this type.
2026-01-04 12:08:10 +01:00
12d0ecf0e6 Be a bit more diligent with task creation 2026-01-04 12:08:10 +01:00
c377ec25dc Introduce the Models module in order to make others internal 2026-01-04 12:08:10 +01:00
915d01e086 Introduce mqttMessageToReceivedZigbeeEvent
To make it more obvious that both cases in mainAsync
just handle events.
2026-01-04 12:08:10 +01:00
ae66114ca1 Make the onEventReceived type more explicit 2026-01-04 12:08:10 +01:00
31e9312731 Make the PartsOfDay module internal 2026-01-04 12:08:10 +01:00
506cf0c848 Accept TimeChanged events instead of PartOfDayChanged events 2026-01-04 12:08:06 +01:00
e226d092d8 Introduce a State object instead of passing in partOfDay
We'll have some more complicated use cases for this later.
2026-01-03 18:58:10 +01:00
eebd72f40c Turn PartOfDayChanged into an event 2026-01-03 18:34:08 +01:00
7ccc523c43 Introduce the handleEvent function in Program
We'll add a second reference to it later.
2026-01-03 18:33:31 +01:00
118dc03fdc Transform onZigbeeEventReceived to onEventReceived
We'll add different events later.
2026-01-03 18:22:34 +01:00
f2864ffc47 Add .editorconfig 2026-01-01 19:24:42 +01:00
9b6420b8a8 Make the day start at 5.30am instead 2026-01-01 18:54:12 +01:00
284fdc1261 Initial commit 2025-11-14 20:44:57 +01:00