Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add an alias to the control panel and binary sensor entities #49

Merged
merged 29 commits into from
Sep 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fe60bfc
Update config_flow.py
xtimmy86x Sep 21, 2023
f7a30c7
Update strings.json
xtimmy86x Sep 21, 2023
3dadddb
Update it.json
xtimmy86x Sep 21, 2023
49c56a8
Update en.json
xtimmy86x Sep 21, 2023
98dc170
Update const.py
xtimmy86x Sep 21, 2023
2d5bd2e
Update alarm_control_panel.py
xtimmy86x Sep 21, 2023
207871d
Update binary_sensor.py
xtimmy86x Sep 21, 2023
18e7a10
Update manifest.json
xtimmy86x Sep 25, 2023
f064552
Update alarm_control_panel.py
xtimmy86x Sep 25, 2023
ced07b5
Update binary_sensor.py
xtimmy86x Sep 25, 2023
4a76bd8
Update config_flow.py
xtimmy86x Sep 25, 2023
a5e71ec
Update const.py
xtimmy86x Sep 25, 2023
ac9d1d1
Update strings.json
xtimmy86x Sep 25, 2023
6e3ae04
Update en.json
xtimmy86x Sep 25, 2023
7a5d59f
Update it.json
xtimmy86x Sep 25, 2023
91470ce
Update helpers.py
xtimmy86x Sep 25, 2023
c8ae35c
Update helpers.py
xtimmy86x Sep 25, 2023
b92b001
Update binary_sensor.py
xtimmy86x Sep 25, 2023
a1e9811
Update helpers.py
xtimmy86x Sep 25, 2023
a249eaf
chore: lint contributors code
palazzem Sep 25, 2023
bbff4c3
Update test_helpers.py
xtimmy86x Sep 25, 2023
ff8bd8a
Update test_helpers.py
xtimmy86x Sep 25, 2023
b1a4cbd
Update test_helpers.py
xtimmy86x Sep 25, 2023
a84545c
Update helpers.py
xtimmy86x Sep 25, 2023
4edb1d6
Update conftest.py
xtimmy86x Sep 25, 2023
7541141
Update test_helpers.py
xtimmy86x Sep 25, 2023
fe88066
Update test_helpers.py
xtimmy86x Sep 25, 2023
37d555f
Update helpers.py
xtimmy86x Sep 25, 2023
49b4ac3
chore: lint contributors code
palazzem Sep 25, 2023
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
Prev Previous commit
Next Next commit
Update test_helpers.py
xtimmy86x authored Sep 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit bbff4c3dbe6a6472713c1609742e7e307ce6de06
29 changes: 28 additions & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

from custom_components.elmo_iess_alarm.exceptions import InvalidAreas
from custom_components.elmo_iess_alarm.helpers import parse_areas_config
from custom_components.elmo_iess_alarm.helpers import generate_entity_name, parse_areas_config


def test_parse_areas_config_valid_input():
@@ -31,3 +31,30 @@ def test_parse_areas_config_raises_value_error():

def test_parse_areas_config_whitespace():
assert parse_areas_config(" 3 , 4 ") == [3, 4]

def test_generate_entity_name_empty():
class MockConfigEntry:
def __init__(self):
self.data = {
"username": "test_user",
}
config_entry = MockConfigEntry()
assert generate_entity_name(config_entry) == "elmo_iess_alarm test_user"

def test_generate_entity_name_with_name():
class MockConfigEntry:
def __init__(self):
self.data = {
"username": "test_user",
}
config_entry = MockConfigEntry()
assert generate_entity_name(config_entry, "window") == "elmo_iess_alarm test_user window"

def test_generate_entity_name_with_none():
class MockConfigEntry:
def __init__(self):
self.data = {
"username": "test_user",
}
config_entry = MockConfigEntry()
assert generate_entity_name(config_entry, None) == "elmo_iess_alarm test_user"