Commit Graph

55 Commits

Author SHA1 Message Date
1226867b8e refactor: make fork independent, rename PriorityQueue 2025-08-01 16:55:44 -05:00
e608843b09 feat: add Close() method to app, context aware channels 2025-08-01 16:55:44 -05:00
Sam Lewis
25076130d8 home zone changed to optional 2025-06-01 17:50:03 -04:00
Sam Lewis
56ccdfbdb2 two url fixes:
- default scheme for legacy connection params
- set paths for http and websocket APIs
2025-01-19 20:58:16 -05:00
saml-dev
c27e596dad Merge pull request #26 from metalmatze/golanglint-ci-fixes
Fix default golanglint-ci errors
2025-01-17 21:25:44 -05:00
saml-dev
b37667f1db Merge pull request #24 from metalmatze/service-errors
Return Service errors
2025-01-17 20:36:30 -05:00
Matthias Loibl
ccebcb869f Fix default golanglint-ci errors
These errors show up when simply running `golangci-lint run ./...` on the project.
2025-01-17 17:59:30 +01:00
Matthias Loibl
02b6c413f1 Return Service errors
Additionally, removed the context that gets passed into the Services but isn't used in one of them. The websockets APIs also don't have any use for context.
2025-01-17 17:50:06 +01:00
Matthias Loibl
b5d35235f8 Parse URL and pass it to clients
Right now, this SDK only works with IP:Port.
I'm however running on https://home.example.com and need https or wss and an implicit port 443.

Using net/url should be the best option.
2025-01-17 01:46:35 +01:00
Dominik Siebel
8b436ce4ee feat: support secure connections 2024-02-22 11:28:05 +01:00
Jiri Luzny
628544c7a0 Log and propagate error instead of using Fatal 2023-12-26 23:28:41 +01:00
Jiri Luzny
a4fbbe5ac3 Setup pretty logging and start refactoring of the library to slog 2023-12-09 21:08:50 +01:00
Sam Lewis
1932f1edf7 make an interface for State object 2023-10-22 18:16:20 -04:00
Lubos Dolezel
ff9f6cb95e Fix a crash in State.getLatLong() 2023-06-02 12:11:40 +02:00
Lubos Dolezel
754ffafeae Don't exit the app on connection failures, expose the error in the API 2023-03-07 18:30:40 +01:00
Lubos Dolezel
23f87fef8b Avoid panic on disconnect 2023-03-07 18:18:14 +01:00
Lubos Dolezel
35a269715b Add getters for Service and State 2023-02-28 12:01:25 +01:00
Lubos Dolezel
f27cbfb299 Fix panics due to concurrent websocket writes 2023-02-24 11:49:26 +01:00
Sam Lewis
447400868d switch back to pointers, but this time add etl := etl when iterating over list to set correct pointer 2023-01-13 21:57:08 -05:00
Sam Lewis
e58a75388e fix bug when registering multiple listeners and change sunrise/sunset to non-ha impl 2023-01-12 22:33:38 -05:00
Sam Lewis
c8128b5dba change to vanity url saml.dev 2022-12-12 00:15:00 -05:00
Sam Lewis
ced79559e5 split daily schedule and interval 2022-11-13 20:17:00 -05:00
Sam Lewis
f6c68fe8ca add comment 2022-11-10 20:27:34 -05:00
Sam Lewis
0f970c2732 fix runonstartup bug 2022-11-09 21:03:57 -05:00
Sam Lewis
7fda113913 add etl.RunOnStartup 2022-11-09 20:16:35 -05:00
Sam Lewis
1ec5878ff9 add state as second arg for eventListenerCallback 2022-11-08 22:48:34 -05:00
Sam Lewis
5afa301f36 add before/after sunset/sunrise to state 2022-11-06 16:10:05 -05:00
Sam Lewis
ba9132745e add notify service 2022-11-06 15:00:39 -05:00
Sam Lewis
648eb62cfa fix bug when registering multiple schedules and >=1 are sunset/sunrise 2022-11-04 22:47:42 -04:00
Sam Lewis
2575525528 make App exported 2022-11-04 21:10:14 -04:00
Sam Lewis
b0804e39d0 some tweaks/renames, schedule documentation 2022-11-01 01:20:15 -04:00
Sam Lewis
d158524783 add Exceptions to eventListener 2022-10-31 02:01:24 -04:00
Sam Lewis
d077c3feec DRY duration parsing 2022-10-31 01:36:40 -04:00
Sam Lewis
ce6649dd29 fix refactor error 2022-10-31 01:20:52 -04:00
Sam Lewis
8a59770936 enforce ToState when using Duration 2022-10-31 01:17:20 -04:00
Sam Lewis
b22b544437 add Duration for entityListener and rename TimeString to DurationString 2022-10-30 23:07:54 -04:00
Sam Lewis
5e2d6cb092 export strucs 2022-10-26 23:05:14 -04:00
Sam Lewis
66e179c568 sunrise sunset working, not the cleanest solution but it works 2022-10-24 23:03:04 -04:00
Sam Lewis
e2fb6872ae make some things private 2022-10-23 18:53:38 -04:00
Sam Lewis
83789184f0 event listeners working 2022-10-19 00:25:15 -04:00
Sam Lewis
ccd6805d40 cleanup todos that are done 2022-10-17 12:37:36 -04:00
Sam Lewis
2c5e68903a added Throttle to entityListener 2022-10-16 23:41:21 -04:00
Sam Lewis
145c12dd25 all builders now take duration strings 2022-10-16 22:45:13 -04:00
Sam Lewis
6ca78e88dd listeners working, sunrise/sunset working with string offset 2022-10-16 22:23:46 -04:00
Sam Lewis
8b888a2d89 set up entityListener and switch websocket library 2022-10-16 15:20:04 -04:00
Sam Lewis
2d77c4b657 schedule works! 🎉🔥 2022-10-15 22:22:59 -04:00
Sam Lewis
b99c1e5925 Added lots of services and fixed bug with ID for websocket calls 2022-10-13 02:17:36 -04:00
Sam Lewis
4cf16d0d41 moved websocket code to websocket package 2022-10-11 22:58:44 -04:00
Sam Lewis
911c3521ba switched to time.Duration 2022-10-11 02:17:02 -04:00
Sam Lewis
7bcca889f9 good progress yay:
- impl http client
- create http client in App()
- generic builder for Service.*
- set Service on app to pass to callbacks later
- impl State
- set State on app to pass to callbacks later
- change panic to log.Fatalln
2022-10-11 01:22:23 -04:00