Skip to content

Commit

Permalink
Merge pull request #199 from omerfaruk-aran/model-checker
Browse files Browse the repository at this point in the history
🚀 Samsung AC Model Checker Implementation
  • Loading branch information
lanwin authored Oct 24, 2024
2 parents 1ba46cf + c9c49c9 commit 935e460
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/model-checker/index.html
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>
37 changes: 37 additions & 0 deletions docs/model-checker/script.js
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>
`;
}
72 changes: 72 additions & 0 deletions docs/model-checker/style.css
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;
}

0 comments on commit 935e460

Please sign in to comment.