{"type":"video","version":"1.0","html":"<iframe src=\"https://www.loom.com/embed/8348e3854663466ab6272aaa5291b103\" frameborder=\"0\" width=\"1376\" height=\"1032\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>","height":1032,"width":1376,"provider_name":"Loom","provider_url":"https://www.loom.com","thumbnail_height":1032,"thumbnail_width":1376,"thumbnail_url":"https://cdn.loom.com/sessions/thumbnails/8348e3854663466ab6272aaa5291b103-c9216454a2e2ce51.gif","duration":958.766,"title":"Smart Home Application Design, Generics, Patterns","description":"This Loom explains the architecture of a smart home application, focusing on how devices are implemented using generics, state machines, and device-specific actions. The author describes an abstract base device that requires each device to define device states, a device state type, and actions, then demonstrates implementations such as a door lock and a thermostat with modes like heat, cool, and auto. Higher level components like controllers and services translate front end or API inputs into enums, use factories and creators to instantiate devices, and centralize validation and global exception handling. The Loom also covers audit logging and persistence, and notes the project is still a work in progress with no testing shown because it was built by a single person."}