Commit Graph

33 Commits

Author SHA1 Message Date
Joshua Rich ec7a7e08e8 fix(agent,hass,device): better clean-up on agent quit/cancellation 2023-10-24 23:17:04 +10:00
Joshua Rich 6603e061f6 fix(agent,hass): fix logic around retrying websocket connection 2023-10-03 12:57:53 +00:00
Joshua Rich 6fee81f772 fix(agent,hass): remove Fyne-isms from notification code 2023-09-17 05:13:29 +00:00
Joshua Rich 89fd9e2951 fix(agent): agent struct doesn't need to export any fields 2023-09-17 00:15:34 +00:00
Joshua Rich f71dbb27be style(agent): fix spelling, remove commented code 2023-09-17 00:02:50 +00:00
Joshua Rich 7eb18bb065 refactor(agent,hass,tracker)!: split UI into own package and more interface usage
- Split the UI code into its own package, seperate from the agent code
- Create more interfaces between packages that need to share objects
2023-09-16 23:57:34 +00:00
Joshua Rich 1f74f8356f fix(hass): websocket connection should gracefully handle home assistant disconnects/restarts 2023-09-14 00:41:04 +00:00
Joshua Rich 9d824caf09 feat(agent,hass,tracker): move to interface access to agent config
- agent config is now accessed via an interface. This allows for easier
  switching of config backend in the future.
- hass and tracker access to config is through interface as well.
- all interfaces share common methods so any implementation can easily
  satisfy all usage criteria.
2023-09-11 00:12:01 +00:00
Joshua Rich c703d677d9 refactor(hass): merge api package under hass package, as api is for hass only 2023-07-23 11:26:02 +00:00
Joshua Rich a972f66b88 feat(agent,api): websocket connection fetches needed config from interface 2023-07-16 12:07:17 +00:00
Joshua Rich dde62dbb25 refactor(api): move websocket code into api package 2023-07-16 11:40:49 +00:00
Joshua Rich e8befd2cb5 fix(agent): bail on websocket creation if running headless 2023-07-16 11:13:14 +00:00
Joshua Rich 2ce72c5792 fix(agent): expose error messages for config issues, remove call trace 2023-07-10 12:20:33 +00:00
Joshua Rich 64ab6913cf refactor(agent,hass): simplify notification channel handling 2023-05-15 22:07:07 +10:00
Joshua Rich 33242fe735 refactor(config): update config fetch/store functions 2023-05-14 17:36:25 +10:00
Joshua Rich 2607346773 fix(hass): fix websocket not working and migrate to different websocket package 2023-05-09 08:43:11 +10:00
Joshua Rich e6f6563bba refactor(agent): don't export fyne app components 2023-04-24 20:15:29 +10:00
Joshua Rich 1adf549567 - HA API responses now treated as bytes.Buffer with the response handler
doing whatever it wants with that (most likely unmarshal to JSON).
- Simplify location updater.
- Initial code for handling fetching config from HA an using this to
  update sensor tracker.
2023-04-18 09:40:53 +10:00
Joshua Rich ab55cb40c8 Try to handle some more networking issues gracefully. 2023-04-13 20:50:52 +10:00
Joshua Rich bcbe03ee14 Add licensing.
Better sensor icons for Linux network sensors.
2023-04-10 09:45:12 +10:00
Joshua Rich 5ef33ad6e6 Rewrite app tracking on Linux to avoid intermediate state. 2023-04-09 23:02:35 +10:00
Joshua Rich 71549447a5 Add network sensors on Linux.
Better config loading process with initial code to validate.
Better registration process.
2023-04-09 21:09:05 +10:00
Joshua Rich 37cdac5692 Better websocket handling.
Add initial code for tracking network sensors in Linux.
Improvements to DBus API for Linux and more helper functions.
Minor code tweaks and renaming in other places.
2023-04-08 13:46:26 +10:00
Joshua Rich 37fa3473f3 Move config to its own package. Create methods to add config
as context value.
Use a context with a config value attached in worker functions.
Create a sensorState struct. Make each sensor type be this base struct.
2023-04-02 13:59:12 +10:00
Joshua Rich 5ef6292f59 More major work to utilise and inherit a context set at the root level,
and handle it being cancelled.
Add more helper functions for Linux.
Rename and move some code (Home Assistant websocket/api related).
2023-04-01 21:19:42 +10:00
Joshua Rich cf2cb19001 Major rework of notifications and websocket code.
All sensor workers should shut down cleanly.
Related to above, better use of contexts and inheritance of them.
2023-04-01 12:10:54 +10:00
Joshua Rich 0d0f8146bd Linux battery sensors PoC code.
More cleverer use of interfaces. A sensor can satisfy being its own
request to HA as well.
2023-03-31 10:17:57 +10:00
Joshua Rich d69f68b2ed Major restructure of codebase.
Better handling of notifications websocket.
HASS API requests can be run in own goroutine.
2023-03-30 09:42:57 +10:00
Joshua Rich d657e8bd98 Lots of restructure so that root command is simpler.
Remove processRequests handler. Requests can be done as needed.
2023-03-29 13:12:03 +10:00
Joshua Rich a3f2221bb0 Add an icon.
Try to improve network handling for notifications websocket.
Fix active apps sensors.
2023-03-28 18:49:51 +10:00
Joshua Rich 692036cff4 Update debug messages to have call traces. 2023-03-28 11:29:42 +10:00
Joshua Rich ff6a2a881a Notifications working. 2023-03-27 18:28:54 +10:00
Joshua Rich be9c78f2cd Initial implementation of notification handling. 2023-03-27 16:29:39 +10:00