question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow forcing lower-casing of entity ids.

See original GitHub issue

Some devices append a .Battery_State while some append .battery_state.

This could be reconciled by forcing lower-case, and/or a separate mapping output that is forced into a lower-case state.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
legregocommented, Dec 4, 2019

My concern is that I will be adding a non-trivial number of custom_entities to accomplish what I want, rather than a single line blanket configuration argument.

Yeah, I’ve had a hard time balancing the configuration options here (easy vs. highly customizable). We could of course support both, but I was trying to converge on a set of config options that would satisfy most folks, most of the time.

That being said, I don’t really envision folks wanting to force lower case for some entities, but not others. Perhaps an all-or-nothing config would be better in this case.

In the mapping, are these entity_ids always keyword? What if they were inverted default, where keyword was the default type, but text as well (.text)? This would allow for easy, analyzed search of substrings within heavily dot-infested entity ids.

Yes, they are stored as keyword today, but I don’t see a reason why we couldn’t/shouldn’t also store as .text:

https://github.com/legrego/homeassistant-elasticsearch/blob/e25f33250c2e7ac4b966a826d8c2900b4c0eb894/custom_components/elastic/index_mapping.json#L15-L18

1reaction
untergeekcommented, Jan 27, 2020

Hard to argue about backward compatibility. I think the principle of least astonishment implies we shouldn’t change it.

However, what if we alter the mapping to make it a separate field of the parent mapping?

entity_id.lower? or entity_id.downcase?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Spring boot JPA insert in TABLE with uppercase name ...
AUTO) private int id; ..... When i try to insert new record in database, the table name was translated in lowercase as :...
Read more >
Allow configuration for migrations to specify case for indexes ...
I often run into cases in migrations where they try to rename an index or foreign key to be uppercase even if the...
Read more >
PostgreSQL auto-converts column names into lowercase
Problem PostgreSQL converts all table column names into lowercase, unless quoted. Goal Retain letter-casing of table column names.
Read more >
PostgreSQL force upper case for all data
Generally, you need UPPER CASE for displaying the data to the end user. If so,. STEP 1: identify the tables & columns and...
Read more >
Collations and case sensitivity - EF Core - Microsoft Learn
Configuring collations and case-sensitivity in the database and on queries with Entity Framework Core.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found