Skip to content
This repository was archived by the owner on Mar 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
b3481c4
new branch test
SimonPergel Jan 21, 2025
a6f269d
new test file added
SimonPergel Jan 22, 2025
1223c78
Corrected the calculating function
Jan 22, 2025
f5ded85
Fixed API calls to only do it one time with several instances?
Jan 23, 2025
a146df7
Small fix to make the instances sleep a bit
Jan 23, 2025
5f9f8e4
Merge branch 'master' into Comfortstat
Jan 23, 2025
7ca06c1
Added Alex fix to Jan's code
Jan 23, 2025
a95b553
Ran go mod tidy
Jan 23, 2025
cc8ff43
more tests added
SimonPergel Jan 23, 2025
d6e6a1f
added more tests for the getters in things.go
SimonPergel Jan 23, 2025
df3d27c
Merge branch 'master' into Comfortstat
Jan 24, 2025
8fb3b25
Fixed API to not be called in init_template
Jan 24, 2025
6bd7214
fixed the set-functions in thing.go and added more tests
SimonPergel Jan 24, 2025
8b9f869
Added working tests for getters och setters functions
SimonPergel Jan 24, 2025
260cba2
added some more tests
SimonPergel Jan 24, 2025
2b73ffa
Merge remote-tracking branch 'origin/workflow' into Comfortstat
SimonPergel Jan 24, 2025
ffe9cc1
adding tests plus cleaning up things.go
SimonPergel Jan 28, 2025
95fac3b
trying to test processfeedbackLoop
SimonPergel Jan 28, 2025
1ea88dc
trying to test processfeedbackLoop
SimonPergel Jan 28, 2025
db73ae6
cleand up some things
SimonPergel Jan 29, 2025
d453a4a
working in GetapiPrice test
SimonPergel Jan 29, 2025
39b6aa0
cleaned up some comments and added some comments to parts with no ex…
SimonPergel Jan 29, 2025
f5fef4b
More tests
SimonPergel Jan 29, 2025
2224f3d
not there yet, but the push tests are woring fine
SimonPergel Jan 30, 2025
41add31
not there yet, but the pushed tests are working fine
SimonPergel Jan 30, 2025
1281db4
more tests
SimonPergel Jan 30, 2025
2cf76b6
fixes testing bad body
lmas Jan 30, 2025
b2dbfe2
test for things.go is completed
SimonPergel Jan 30, 2025
29b556d
added working test of the GET parts
SimonPergel Jan 31, 2025
2521e46
cleaned up and added some comments to clarify diffrent parts
SimonPergel Feb 2, 2025
161e287
added test for the PUT part in Comfortstat.go
SimonPergel Feb 3, 2025
8b7971b
Updated newUnitAsset
SimonPergel Feb 3, 2025
2434825
updated getapiprice function to match linter tests
SimonPergel Feb 3, 2025
64b925d
added a part that validate the url in getApiPricedata
SimonPergel Feb 4, 2025
79cab32
added error handling in getApiPricedata
SimonPergel Feb 4, 2025
de331da
added error handling in the pricefeedbackloop
SimonPergel Feb 4, 2025
9b0086a
added error handling in pricefeedbackloop
SimonPergel Feb 4, 2025
9a8d9af
cleaned up some log.prints in the set-functions
SimonPergel Feb 4, 2025
01af2e1
moved the check for the statuscode to the right place, before reading…
SimonPergel Feb 4, 2025
e4dca4e
fixed so that i run the tests directly after the fuction call
SimonPergel Feb 4, 2025
4e22141
changed the name to a more suitable name
SimonPergel Feb 4, 2025
7ccffce
Reverts " changed the name to a more suitable name"
lmas Feb 4, 2025
108b245
changed to a more suitable name
SimonPergel Feb 4, 2025
9308c0a
replaced the sleep in things.go to Comfortstat.go
Feb 5, 2025
2e32040
Added user temperature to the comfortstat
Feb 7, 2025
4897efb
added some comments and removed emty lines
SimonPergel Feb 7, 2025
27915d7
fixed the setter-methods
SimonPergel Feb 7, 2025
f4667fe
Added special case for the user temp
Feb 10, 2025
dfb65b5
Changed userTemp to UserTemp so it is exported as json
Feb 10, 2025
aed44a4
cleaned up some emty rows and created some explanatory comments
SimonPergel Feb 11, 2025
e68e039
Resolved all the comments in the review part
SimonPergel Feb 11, 2025
ed7d584
Removed one feedbackloop as it was unnecessary, fixed the hourly pric…
Feb 11, 2025
9b7a64b
added so the user can choose price region
SimonPergel Feb 12, 2025
885c07a
cleand up the new switchRegion function and added some comments
SimonPergel Feb 12, 2025
b59a0fe
Added tests for the newly implemented features(Usertemp and REgion c…
SimonPergel Feb 13, 2025
9cc8398
Cleand up the new funtions that have been implemented
SimonPergel Feb 13, 2025
cf530de
Stopped using index, and uses unique id to send requests via zigbee g…
Pake-TU Feb 14, 2025
affc8d7
Added function for switches & getting websocketport
Pake-TU Feb 18, 2025
c731d1f
Cleaned up some code, and added forgotten errorhandlers
Pake-TU Feb 21, 2025
e0017d0
Removed unused code and fields from unitasset, added a few comments
Pake-TU Feb 23, 2025
b70ccb5
Fixed the tests i broke when I changed initTemplate()
Pake-TU Feb 23, 2025
738fa6e
Added func to pair smart plugs w/ their sensors
Pake-TU Feb 24, 2025
c46d0d9
added an error handler that i forgot about
Pake-TU Feb 24, 2025
65d7e95
Added a way to externally toggle smart plugs
Pake-TU Feb 24, 2025
9bf8e1d
fixed comments and changed toggle service name to state
Pake-TU Feb 24, 2025
670b2bc
Added more test, more to come
Pake-TU Feb 24, 2025
f4630b9
Added files for the SunButton system
Feb 25, 2025
73144a7
Refactors websocket func and makes it easier to test
lmas Feb 25, 2025
72771e6
Refactors the startup func so it's easier to test
lmas Feb 25, 2025
6b5e824
Added test files for the SunButton files
gabaxh Feb 25, 2025
1e7fb95
Correction in test code
gabaxh Feb 25, 2025
4cc3282
Fixed the test for ButtonStatus
gabaxh Feb 25, 2025
3dfda7e
more tests
Pake-TU Feb 25, 2025
1a7338e
Last tests done
Pake-TU Feb 26, 2025
8e3f494
added more tests regarding the getApiData
SimonPergel Feb 28, 2025
2527eb6
Merge remote-tracking branch 'origin/dev' into ZigBeeValve
Pake-TU Feb 28, 2025
8fa6366
Fixes spelling errors
lmas Feb 28, 2025
2ece75f
gofmt:ed the thing_test
Pake-TU Feb 28, 2025
c382a48
Merge pull request #80 from lmas/ZigBeeValve
Pake-TU Feb 28, 2025
2bdc07d
Improves error handling, solves bunch of todos
lmas Feb 19, 2025
7a53576
Catches errors in loadConfiguration(), instead of logging by default
lmas Feb 19, 2025
4e26708
Adds docstrings to system file
lmas Feb 20, 2025
cb4ddd4
Adds better list of sampled services
lmas Feb 20, 2025
bb65cc3
Tracks location for each sample
lmas Feb 20, 2025
45ffc80
Adds lots more tests
lmas Feb 24, 2025
6790712
Adds the new data services from zigbee
lmas Feb 28, 2025
8b0d23c
fixed conflicts from dev -> Comfortstat
SimonPergel Mar 4, 2025
21388d5
Fixed misspelling
SimonPergel Mar 4, 2025
504b4d1
Merge pull request #81 from lmas/Comfortstat
SimonPergel Mar 4, 2025
07f46e9
changed name
Pake-TU Mar 4, 2025
28435c9
Merge branch 'dev' into ZigBeeValve
Pake-TU Mar 4, 2025
0da3669
Uses the new zigbee name in docker
lmas Mar 4, 2025
c93d325
Removes the influx ping as the services starts up too slowly
lmas Mar 5, 2025
53ca8f4
Updated port
gabaxh Mar 7, 2025
b4727c4
Updated port number
gabaxh Mar 7, 2025
a611c5b
Update in serving as UserTemp was wrong
gabaxh Mar 7, 2025
f88d577
Updated so API is only called when needed
gabaxh Mar 7, 2025
a75ddf4
merge dev into Comfortstat
gabaxh Mar 7, 2025
a49661d
Made so SunButton tries to send setpoint until it works
gabaxh Mar 7, 2025
8ed778d
Added source files for Godot Application
Pake-TU Mar 7, 2025
43ba7d1
Merge branch 'dev' of github.com:lmas/d0020e_code into dev
Pake-TU Mar 7, 2025
b0d77d7
Adds collector documentation
lmas Mar 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions App/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
2 changes: 2 additions & 0 deletions App/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/
16 changes: 16 additions & 0 deletions App/DesiredTempOverrideCheckButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends CheckButton


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

func _on_toggled(button_pressed):
if button_pressed:
!get_tree().current_sccene.override
print("Override:", get_tree().current_scene.override)
7 changes: 7 additions & 0 deletions App/Options.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends Control

var override = false

# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
55 changes: 55 additions & 0 deletions App/Options.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[gd_scene load_steps=4 format=3 uid="uid://cwpvhktg0fqct"]

[ext_resource type="Script" path="res://Options.gd" id="1_kdsdj"]
[ext_resource type="Script" path="res://OptionsBackButton.gd" id="2_06l4x"]
[ext_resource type="Script" path="res://DesiredTempOverrideCheckButton.gd" id="2_yph5t"]

[node name="Options" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_kdsdj")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -50.0
offset_top = -50.0
offset_right = 50.0
offset_bottom = 50.0
grow_horizontal = 2
grow_vertical = 2

[node name="minTempLabel" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "minTemp"

[node name="minTempText" type="TextEdit" parent="VBoxContainer"]
custom_minimum_size = Vector2(100, 35)
layout_mode = 2
placeholder_text = "min_Temp"

[node name="DesiredTempOverrideCheckButton" type="CheckButton" parent="VBoxContainer"]
layout_mode = 2
text = "DesiredTempOverride"
script = ExtResource("2_yph5t")

[node name="OverrideDesiredTempTextbox" type="TextEdit" parent="VBoxContainer"]
custom_minimum_size = Vector2(100, 35)
layout_mode = 2
placeholder_text = "Desired Temp"

[node name="OptionsBackButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Back"
script = ExtResource("2_06l4x")

[connection signal="toggled" from="VBoxContainer/DesiredTempOverrideCheckButton" to="VBoxContainer/DesiredTempOverrideCheckButton" method="_on_toggled"]
[connection signal="button_down" from="VBoxContainer/OptionsBackButton" to="VBoxContainer/OptionsBackButton" method="_on_button_down"]
15 changes: 15 additions & 0 deletions App/OptionsBackButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends Button


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass


func _on_button_down():
get_tree().change_scene_to_file("res://menu.tscn")
11 changes: 11 additions & 0 deletions App/OptionsButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends Button


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.



func _on_button_down():
get_tree().change_scene_to_file("res://Options.tscn")
11 changes: 11 additions & 0 deletions App/QuitButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends Button


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.



func _on_button_down():
get_tree().quit()
10 changes: 10 additions & 0 deletions App/StartButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends Button


# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.

func _on_button_down():
print("Starting programs")

1 change: 1 addition & 0 deletions App/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions App/icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://40v5s6011q63"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
6 changes: 6 additions & 0 deletions App/menu.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends Control

# Called when the node enters the scene tree for the first time.

func _ready():
pass # Replace with function body.
48 changes: 48 additions & 0 deletions App/menu.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[gd_scene load_steps=5 format=3 uid="uid://dvpcro0lol46r"]

[ext_resource type="Script" path="res://menu.gd" id="1_2af8p"]
[ext_resource type="Script" path="res://StartButton.gd" id="1_6edej"]
[ext_resource type="Script" path="res://QuitButton.gd" id="2_cawfr"]
[ext_resource type="Script" path="res://OptionsButton.gd" id="2_tp1y0"]

[node name="Menu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
script = ExtResource("1_2af8p")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_top = -50.5
offset_bottom = 50.5
grow_horizontal = 2
grow_vertical = 2

[node name="StartButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 0
text = "Start"
script = ExtResource("1_6edej")

[node name="OptionsButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Options"
script = ExtResource("2_tp1y0")

[node name="QuitButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Quit"
script = ExtResource("2_cawfr")

[connection signal="button_down" from="VBoxContainer/StartButton" to="VBoxContainer/StartButton" method="_on_button_down"]
[connection signal="button_down" from="VBoxContainer/OptionsButton" to="VBoxContainer/OptionsButton" method="_on_button_down"]
[connection signal="button_down" from="VBoxContainer/QuitButton" to="VBoxContainer/QuitButton" method="_on_button_down"]
15 changes: 15 additions & 0 deletions App/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=5

[application]

config/name="project"
config/features=PackedStringArray("4.1", "Forward Plus")
config/icon="res://icon.svg"
2 changes: 1 addition & 1 deletion Comfortstat/Comfortstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (t *UnitAsset) Serving(w http.ResponseWriter, r *http.Request, servicePath
t.httpSetSEKPrice(w, r)
case "DesiredTemp":
t.httpSetDesiredTemp(w, r)
case "userTemp":
case "UserTemp":
t.httpSetUserTemp(w, r)
case "Region":
t.httpSetRegion(w, r)
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ lint:

# Runs spellchecker on the code and comments
# This requires this tool to be installed from https://github.com/crate-ci/typos?tab=readme-ov-file
# Example installation:
# cargo install typos-cli
# Example installation (if you have rust installed): cargo install typos-cli
spellcheck:
typos .

Expand Down
Loading