Skip to content

Commit

Permalink
Docker (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjenbos authored Nov 2, 2023
1 parent f4162f9 commit 4ee5afc
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ env
coverage.xml
.secrets
.pytest_cache
docker/config
17 changes: 17 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3.9'
services:
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant
ports:
- 8123:8123
volumes:
- ./config:/config
- ../custom_components/alpha_innotec:/config/custom_components/alpha_innotec
nginx:
image: nginx
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ../tests/fixtures:/var/www
46 changes: 46 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www;
error_page 405 =200 $uri;
location /api/room/list {
alias /var/www/;
try_files controller_api_room_list.json =404;
}

location /admin/systeminformation/get {
alias /var/www/;
try_files controller_admin_systeminformation_get.json =404;
}

location /api/room/settemperature {
alias /var/www/;
try_files controller_api_room_settemperature.json =404;
}

location /admin/login/check {
alias /var/www/;
try_files controller_admin_login_check.json =404;
}

location /api/user/token/challenge {
alias /var/www/;
try_files controller_api_user_token_challenge.json =404;
}

location /api/user/token/response {
alias /var/www/;
try_files controller_api_user_token_response.json =404;
}

location /api/gateway/dbmodules {
alias /var/www/;
try_files gateway_api_dbmodules.json =404;
}

location /api/gateway/allmodules {
alias /var/www/;
try_files gateway_api_allmodules.json =404;
}
}
6 changes: 6 additions & 0 deletions tests/fixtures/controller_admin_login_check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"success": true,
"message": "",
"language": "en",
"performance": 0.047
}
2 changes: 1 addition & 1 deletion tests/fixtures/controller_api_room_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@
],
"language": "en",
"performance": 0.907
}
}
6 changes: 6 additions & 0 deletions tests/fixtures/controller_api_room_settemperature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"success": true,
"message": "",
"language": "en",
"performance": 0.047
}
1 change: 1 addition & 0 deletions tests/fixtures/controller_api_user_token_challenge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"success": true, "message": "", "loginRejected": false, "devicetoken": "7f594a2e44244d1f92df88d7dccaed48", "language": "en", "performance": 0.042}
1 change: 1 addition & 0 deletions tests/fixtures/controller_api_user_token_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"success": true, "message": "", "loginRejected": false, "devicetoken_encrypted": "W9UIefCF9T7jQGmagrhsJPEldxM5iher+CSAIvbas84=", "userid": 4, "language": "en", "performance": 0.202}
2 changes: 1 addition & 1 deletion tests/fixtures/gateway_api_allmodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@
},
"language": "en",
"performance": 0.75
}
}
2 changes: 1 addition & 1 deletion tests/fixtures/gateway_api_dbmodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@
},
"language": "en",
"performance": 0.138
}
}
2 changes: 1 addition & 1 deletion tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def test_setup_config(hass: HomeAssistant):

with patch(
target=f"{MODULE}.config_flow.validate_input",
return_value=json.loads(load_fixture("controller_api_systeminformation.json")),
return_value=json.loads(load_fixture("controller_admin_systeminformation_get.json")),
) as mock_setup_entry:
result = await hass.config_entries.flow.async_configure(
result["flow_id"],
Expand Down

1 comment on commit 4ee5afc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HA Alpha Innotec Coverage

HA Alpha Innotec
FileStmtsMissCoverMissing
__init__.py21957%19–20, 22, 27, 29, 34, 36–37, 39
api.py44295%48, 51
base_coordinator.py36360%2, 4, 6, 8–11, 13, 16, 18–21, 23, 25–26, 28–31, 33–34, 36–38, 40, 42–44, 46, 58–60, 62–64
binary_sensor.py67670%2, 4–5, 7, 9–12, 17–19, 21, 24, 27, 29, 31, 33, 35, 37–38, 45, 48, 51, 53, 60, 62, 65, 67, 69–70, 72–73, 75–76, 85, 87, 89, 92, 95, 97–101, 103–104, 106, 114–116, 118–119, 121, 123–125, 127–129, 131–136, 138–139
climate.py81810%2, 4–5, 7, 9, 13–15, 20–23, 25, 28, 31–32, 34, 36, 38, 40–41, 49, 52, 55, 57, 64–65, 67, 73, 76, 79–81, 85, 87–93, 95–96, 98, 106–107, 109, 111–112, 115, 117–119, 121–122, 124–126, 128–129, 131, 133, 136–137, 139–141, 143, 145–146, 148, 150, 152–154, 156–157, 159, 161–162, 165
config_flow.py371559%24–25, 27–30, 32–35, 57–61
const.py70100% 
controller_api.py765922%17–18, 20–21, 23–26, 28, 30–33, 35, 38, 40, 43, 45, 50, 52–55, 57, 59–60, 62, 64, 71, 73, 80–81, 83, 85, 87, 89, 91–92, 94, 97, 100–101, 103–106, 108, 111, 114, 120, 122–126, 138–140, 142
gateway_api.py624724%17–19, 21–23, 26–27, 29–30, 32–35, 37, 39–42, 44, 47, 49, 52, 54, 59, 61, 63–65, 67, 69–70, 72, 74, 77, 79, 81–82, 84, 87–88, 90, 93, 96–98, 100
sensor.py55550%2, 4–5, 7–10, 15–18, 20, 23, 26–27, 29, 31, 33, 35–38, 40, 47, 50, 53, 55, 62–63, 65, 71, 74, 77–78, 80, 82–86, 88–89, 91, 99–100, 102, 104–109, 111, 113–114
structs
   Thermostat.py11918%8–16
TOTAL49738023% 

Tests Skipped Failures Errors Time
3 0 💤 0 ❌ 0 🔥 0.692s ⏱️

Please sign in to comment.