From 6dcbf4d0ed32342fb913e5b814df81f652764ebd Mon Sep 17 00:00:00 2001 From: Ari Date: Thu, 1 Sep 2022 15:28:53 -0400 Subject: [PATCH] fixed up centering bug --- api/tests/unittests/test_yaml_serializer.py | 46 +++++++++++++++++++++ webapp/src/components/Page/index.tsx | 4 +- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/api/tests/unittests/test_yaml_serializer.py b/api/tests/unittests/test_yaml_serializer.py index 415fb1e..66b2019 100644 --- a/api/tests/unittests/test_yaml_serializer.py +++ b/api/tests/unittests/test_yaml_serializer.py @@ -65,6 +65,52 @@ class dumping_yamls_tests(TestCase): }, ) + def test_load_template_in_yaml(self): + yaml_obj = load_yaml( + io.StringIO( + """ +- id: '1652069225859' + alias: 'Lower the volume' + description: '' + mode: single + trigger: + - platform: state + entity_id: input_number.preferred_temperature + condition: [] + action: + - service: media_player.volume_set + data_template: + entity_id: media_player.denon_avr_x2500h + volume_level: '{{ ((states(''input_number.volume_video'')|int)+80)/100 }}' + """ + ), + Path.cwd(), + ) + self.assertIsInstance(yaml_obj, list) + self.assertEqual(len(yaml_obj), 1) + self.assertDictEqual( + dict(yaml_obj[0]), + { + "id": "1652069225859", + "alias": "Lower the volume", + "description": "", + "mode": "single", + "trigger": [ + {"platform": "state", "entity_id": "input_number.preferred_temperature"} + ], + "condition": [], + "action": [ + { + "service": "media_player.volume_set", + "data_template": { + "entity_id": "media_player.denon_avr_x2500h", + "volume_level": "{{ ((states('input_number.volume_video')|int)+80)/100 }}", + }, + } + ], + }, + ) + def test_load_stub(self): yaml_obj = load_yaml( io.StringIO( diff --git a/webapp/src/components/Page/index.tsx b/webapp/src/components/Page/index.tsx index 61239b8..ce1b969 100644 --- a/webapp/src/components/Page/index.tsx +++ b/webapp/src/components/Page/index.tsx @@ -60,9 +60,7 @@ export const InternalPage: FC = ({ children, api }) => { }, [conn, snackbar]); return ( -
+
{children}