-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from omerfaruk-aran/model-checker
🚀 Samsung AC Model Checker Implementation
- Loading branch information
Showing
3 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Samsung AC Model Checker</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Samsung AC Model Checker</h1> | ||
<p>Enter your model number to check if it's NASA, Non-NASA, or Other.</p> | ||
<input type="text" id="modelInput" placeholder="Enter Model Number (e.g., AJ080TXJ4KG)"> | ||
<button onclick="checkModel()">Check Model</button> | ||
<div id="result"></div> | ||
</div> | ||
|
||
<footer> | ||
<p>Author: <a href="https://github.com/omerfaruk-aran" target="_blank">Ömer Faruk Aran</a> | Developed for the | ||
ESPHome Samsung HVAC Project</p> | ||
</footer> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function checkModel() { | ||
const model = document.getElementById("modelInput").value.toUpperCase(); | ||
const result = document.getElementById("result"); | ||
|
||
if (model.length < 11) { | ||
result.textContent = "Please enter a valid model number."; | ||
return; | ||
} | ||
|
||
const classification = model.substring(0, 2); | ||
const capacity = model.substring(2, 5); | ||
const productType = model.charAt(6); | ||
const productNotation = model.charAt(7); | ||
const feature = model.charAt(8); | ||
const ratingVoltage = model.charAt(9); | ||
const mode = model.charAt(10); | ||
|
||
let type = "Other"; | ||
if (productType === "S" || productType === "N" || productType === "X") { | ||
type = "NASA"; | ||
} else if (productType === "A" || productType === "B" || productType === "C") { | ||
type = "Non-NASA"; | ||
} | ||
|
||
result.innerHTML = ` | ||
<div class="result-container"> | ||
<p><strong>Model:</strong> ${model}</p> | ||
<p><strong>Classification:</strong> ${classification}</p> | ||
<p><strong>Capacity:</strong> ${capacity} kW</p> | ||
<p><strong>Product Type:</strong> <span class="highlight">${productType} (${type})</span></p> | ||
<p><strong>Product Notation:</strong> ${productNotation}</p> | ||
<p><strong>Feature:</strong> ${feature}</p> | ||
<p><strong>Rating Voltage:</strong> ${ratingVoltage}</p> | ||
<p><strong>Mode:</strong> ${mode}</p> | ||
</div> | ||
`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
} | ||
|
||
.container { | ||
background-color: white; | ||
padding: 20px; | ||
border-radius: 10px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
text-align: center; | ||
flex: 1; | ||
} | ||
|
||
input { | ||
margin-top: 10px; | ||
padding: 10px; | ||
border-radius: 5px; | ||
border: 1px solid #ddd; | ||
width: 350px; | ||
} | ||
|
||
button { | ||
margin-top: 10px; | ||
padding: 10px; | ||
border-radius: 5px; | ||
border: 1px solid #ddd; | ||
background-color: #007BFF; | ||
color: white; | ||
cursor: pointer; | ||
width: 200px; | ||
} | ||
|
||
button:hover { | ||
background-color: #0056b3; | ||
} | ||
|
||
footer { | ||
background-color: #f1f1f1; | ||
text-align: center; | ||
padding: 10px; | ||
width: 100%; | ||
} | ||
|
||
.result-container { | ||
background-color: #fff; | ||
border: 1px solid #ddd; | ||
border-radius: 8px; | ||
padding: 20px; | ||
margin-top: 20px; | ||
text-align: left; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.result-container strong { | ||
color: #333; | ||
} | ||
|
||
.result-container .highlight { | ||
color: #007BFF; | ||
font-weight: bold; | ||
font-size: 1.1em; | ||
} |