Closed iantrich closed 6 years ago
Thanks for the PR, just a couple comments. I can try to update this when I have time, but feel free to update yourself if you want to. My biggest concern is with having a separate config option for each style. This way we would have to add a new option for every style someone might want to use. I prefer to follow the way picture-elements does it and just allow people to add any style they want and apply them all. Then we can remove the font_color
option as well
I think that is a solid plan. I am on vacation for the next week so won't be able to touch it till at least next weekend.
I believe I have addressed all your concerns. Let me know if there is anything more I can do! Thanks.
Thanks for updating this. I am good with most of this other than globally replacing commas as they mean different things depending on where you are in the world. Do you have an example of a platform that returns a numerical value as a string with separators?
Side note; this card is working great for me:
Wow that looks awesome. Good work. I'm glad someone is getting some use out of this 🙂
I believe this change should satisfy the "issue" with numeric strings
Sensor values are not always integers 🙁
I still think this needs to be fixed in the platform and we shouldn't try to massage arbitrary strings into numerical values here
Ugh, you're right.
I don't think this sensor is alone though. Could check if float or int
function isInt(n){
return Number(n) === n && n % 1 === 0;
}
function isFloat(n){
return Number(n) === n && n % 1 !== 0;
}
https://stackoverflow.com/questions/3885817/how-do-i-check-that-a-number-is-float-or-integer
I imagine as the history graph has values for these values, something similar is done there as well.
Regardless, I'm going to back this off again and you can merge it and I'll just use template sensors for now.
Okay sounds good. I'm sure we could come up with a way to coerce the string values, but I think that ignores the bigger problem of sensors returning strings where there should be numbers
Absolutely. I'm off onto bigger and better things now...like the reason I need to track things with my Fitbit: https://imgur.com/a/T1bb6RH
PR for the following issues: Units of meausrement Handling commas Using attribute instead of state Support font_family Support text_shadow
I am not a web dev (C++) so hopefully I didn't botch these too bad :)