custom-components / authenticated

A platform which allows you to get information about sucessfull logins to Home Assistant.
MIT License
82 stars 28 forks source link

Sensors not being created #78

Closed kaizersoje closed 2 years ago

kaizersoje commented 2 years ago

Version of the custom_component

21.9.0

Describe the bug A clear and concise description of what the bug is. The sensors are not being created by the integration. I am not sure what the issue is.

log

2022-02-12 22:18:34 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up authenticated platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/authenticated/sensor.py", line 85, in setup_platform
sensor.initial_run()
File "/config/custom_components/authenticated/sensor.py", line 112, in initial_run
self.stored = get_outfile_content(self.out)
File "/config/custom_components/authenticated/sensor.py", line 282, in get_outfile_content
content = yaml.load(out_file, Loader=yaml.FullLoader)
File "/usr/local/lib/python3.9/site-packages/yaml/__init__.py", line 81, in load
return loader.get_single_data()
File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 49, in get_single_data
node = self.get_single_node()
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 64, in compose_node
if self.check_event(AliasEvent):
File "/usr/local/lib/python3.9/site-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/usr/local/lib/python3.9/site-packages/yaml/parser.py", line 449, in parse_block_mapping_value
if not self.check_token(KeyToken, ValueToken, BlockEndToken):
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 116, in check_token
self.fetch_more_tokens()
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 247, in fetch_more_tokens
return self.fetch_single()
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 652, in fetch_single
self.fetch_flow_scalar(style='\'')
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 666, in fetch_flow_scalar
self.tokens.append(self.scan_flow_scalar(style))
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 1151, in scan_flow_scalar
chunks.extend(self.scan_flow_scalar_spaces(double, start_mark))
File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 1238, in scan_flow_scalar_spaces
raise ScannerError("while scanning a quoted scalar", start_mark,
yaml.scanner.ScannerError: while scanning a quoted scalar
in "/config/.ip_authenticated.yaml", line 1869, column 17
found unexpected end of stream
in "/config/.ip_authenticated.yaml", line 1869, column 18
poldim commented 2 years ago

Similarly, getting this error:

Logger: homeassistant.components.sensor
Source: custom_components/authenticated/sensor.py:282
Integration: Sensor (documentation, issues)
First occurred: 1:03:50 PM (1 occurrences)
Last logged: 1:03:50 PM

Error while setting up authenticated platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/authenticated/sensor.py", line 85, in setup_platform
    sensor.initial_run()
  File "/config/custom_components/authenticated/sensor.py", line 112, in initial_run
    self.stored = get_outfile_content(self.out)
  File "/config/custom_components/authenticated/sensor.py", line 282, in get_outfile_content
    content = yaml.load(out_file, Loader=yaml.FullLoader)
  File "/usr/local/lib/python3.9/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.9/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/local/lib/python3.9/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.9/site-packages/yaml/parser.py", line 428, in parse_block_mapping_key
    if self.check_token(KeyToken):
  File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 115, in check_token
    while self.need_more_tokens():
  File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 152, in need_more_tokens
    self.stale_possible_simple_keys()
  File "/usr/local/lib/python3.9/site-packages/yaml/scanner.py", line 291, in stale_possible_simple_keys
    raise ScannerError("while scanning a simple key", key.mark,
yaml.scanner.ScannerError: while scanning a simple key
  in "/config/.ip_authenticated.yaml", line 51, column 1
could not find expected ':'
  in "/config/.ip_authenticated.yaml", line 52, column 15
ludeeus commented 2 years ago

Your YAML files are broken, run .ip_authenticated.yaml through a YAML linter or remove the file then restart HA.